You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
5.1 KiB
159 lines
5.1 KiB
2 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Dojo Select Widget Test</title>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
var djConfig = {
|
||
|
isDebug: true};
|
||
|
</script>
|
||
|
<script type="text/javascript" src="../../dojo.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
dojo.require("dojo.widget.Select");
|
||
|
</script>
|
||
|
<script>
|
||
|
function setVal1(val){
|
||
|
dojo.byId('value1').value=val;
|
||
|
}
|
||
|
function setVal2(val){
|
||
|
dojo.byId('value2').value=val;
|
||
|
}
|
||
|
function setVal3(val){
|
||
|
dojo.byId('value3').value=val;
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<h1>Dojo Select Widget Test</h1>
|
||
|
<p>
|
||
|
The Select widget is an enhanced version of HTML's <select> tag.
|
||
|
</p>
|
||
|
<p>
|
||
|
Similar features:
|
||
|
<ul>
|
||
|
<li>There is a drop down list of possible values.</li>
|
||
|
<li>You can only enter a value from the drop down list. (You can't enter an arbitrary value.)</li>
|
||
|
<li>The value submitted with the form is the hidden value (ex: CA),</li>
|
||
|
<li>not the displayed value a.k.a. label (ex: California)</li>
|
||
|
</ul>
|
||
|
</p>
|
||
|
|
||
|
<p>
|
||
|
Enhancements over plain HTML version:
|
||
|
<ul>
|
||
|
<li>If you type in some text then it will filter down the list of possible values in the drop down list.</li>
|
||
|
<li>List can be specified either as a static list or via a javascript function (that can get the list from a server)</li>
|
||
|
</ul>
|
||
|
</p>
|
||
|
<hr>
|
||
|
|
||
|
<form action="#" method="GET">
|
||
|
|
||
|
<p>Select #1: inlined data, autocomplete=false:</p>
|
||
|
<select name="state3" dojoType="Select" style="width: 300px;" autocomplete="false"
|
||
|
onValueChanged="setVal1">
|
||
|
<option value="AL">Alabama</option>
|
||
|
<option value="AK">Alaska</option>
|
||
|
<option value="AS">American Samoa</option>
|
||
|
<option value="AZ">Arizona</option>
|
||
|
<option value="AR">Arkansas</option>
|
||
|
<option value="AE">Armed Forces Europe</option>
|
||
|
<option value="AP">Armed Forces Pacific</option>
|
||
|
<option value="AA">Armed Forces the Americas</option>
|
||
|
<option value="CA">California</option>
|
||
|
<option value="CO">Colorado</option>
|
||
|
<option value="CT">Connecticut</option>
|
||
|
<option value="DE">Delaware</option>
|
||
|
<option value="DC">District of Columbia</option>
|
||
|
<option value="FM">Federated States of Micronesia</option>
|
||
|
<option value="FL">Florida</option>
|
||
|
<option value="GA">Georgia</option>
|
||
|
<option value="GU">Guam</option>
|
||
|
<option value="HI">Hawaii</option>
|
||
|
<option value="ID">Idaho</option>
|
||
|
<option value="IL">Illinois</option>
|
||
|
<option value="IN">Indiana</option>
|
||
|
<option value="IA">Iowa</option>
|
||
|
<option value="KS">Kansas</option>
|
||
|
<option value="KY">Kentucky</option>
|
||
|
<option value="LA">Louisiana</option>
|
||
|
<option value="ME">Maine</option>
|
||
|
<option value="MH">Marshall Islands</option>
|
||
|
<option value="MD">Maryland</option>
|
||
|
<option value="MA">Massachusetts</option>
|
||
|
<option value="MI">Michigan</option>
|
||
|
<option value="MN">Minnesota</option>
|
||
|
<option value="MS">Mississippi</option>
|
||
|
<option value="MO">Missouri</option>
|
||
|
<option value="MT">Montana</option>
|
||
|
<option value="NE">Nebraska</option>
|
||
|
<option value="NV">Nevada</option>
|
||
|
<option value="NH">New Hampshire</option>
|
||
|
<option value="NJ">New Jersey</option>
|
||
|
<option value="NM">New Mexico</option>
|
||
|
<option value="NY">New York</option>
|
||
|
<option value="NC">North Carolina</option>
|
||
|
<option value="ND">North Dakota</option>
|
||
|
<option value="MP">Northern Mariana Islands</option>
|
||
|
<option value="OH">Ohio</option>
|
||
|
<option value="OK">Oklahoma</option>
|
||
|
<option value="OR">Oregon</option>
|
||
|
<option value="PA">Pennsylvania</option>
|
||
|
<option value="PR">Puerto Rico</option>
|
||
|
<option value="RI">Rhode Island</option>
|
||
|
<option value="SC">South Carolina</option>
|
||
|
<option value="SD">South Dakota</option>
|
||
|
<option value="TN">Tennessee</option>
|
||
|
<option value="TX">Texas</option>
|
||
|
<option value="UT">Utah</option>
|
||
|
<option value="VT">Vermont</option>
|
||
|
<option value="VI">Virgin Islands, U.S.</option>
|
||
|
<option value="VA">Virginia</option>
|
||
|
<option value="WA">Washington</option>
|
||
|
<option value="WV">West Virginia</option>
|
||
|
<option value="WI">Wisconsin</option>
|
||
|
<option value="WY">Wyoming</option>
|
||
|
</select>
|
||
|
<br>
|
||
|
<div>Value: <input id="value1" disabled></div>
|
||
|
<hr>
|
||
|
|
||
|
<p>Select #2: dataUrl, autocomplete=true:</p>
|
||
|
<input dojoType="Select" value="this should never be seen - it is replaced!"
|
||
|
dataUrl="comboBoxData.js" style="width: 300px;" name="state1"
|
||
|
onValueChanged="setVal2"
|
||
|
>
|
||
|
<br>
|
||
|
<div>Value: <input id="value2" disabled></div>
|
||
|
<hr>
|
||
|
|
||
|
<p>Select #3: dataUrl, autocomplete=false:</p>
|
||
|
<input dojoType="Select" value="this should never be seen - it is replaced!"
|
||
|
dataUrl="comboBoxData.js" style="width: 300px;" name="state2" autocomplete="false"
|
||
|
onValueChanged="setVal3"
|
||
|
>
|
||
|
<br>
|
||
|
<div>Value: <input id="value3" disabled></div>
|
||
|
<hr>
|
||
|
|
||
|
<input type="submit">
|
||
|
|
||
|
</form>
|
||
|
<p>
|
||
|
this is some text below the combo boxes. It shouldn't get pushed out of the way when search results get returned.
|
||
|
also: adding a simple combo box to test IE bleed through problem:
|
||
|
</p>
|
||
|
|
||
|
<select>
|
||
|
<option>test for</option>
|
||
|
<option">IE bleed through</option>
|
||
|
<option>problem</option>
|
||
|
</select>
|
||
|
|
||
|
<!-- maintain state of select if user presses back/forward button -->
|
||
|
<form name="_dojo_form" style="display:none" disabled="true"><textarea name="stabile" cols="80" rows="10"></textarea></form>
|
||
|
</body>
|
||
|
</html>
|