Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 8118b77

Browse files
ehyndsScott Jehl
ehynds
authored and
Scott Jehl
committed
documenting disabled options and optgroup support
1 parent 45aeb99 commit 8118b77

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/forms/forms-selects.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,40 @@ <h2>Placeholder options</h2>
179179
</select>
180180
</div>
181181

182+
183+
<h2>Disabled options</h2>
184+
<p>jQuery Mobile will automatically disable and style option tags with the <code>disabled=&quot;disabled&quot;</code> attribute. In the demo below, the second option &quot;Rush: 3 days&quot; has been set to disabled.</p>
185+
186+
<div data-role="fieldcontain">
187+
<label for="select-choice-7" class="select">Choose shipping method:</label>
188+
<select name="select-choice-7" id="select-choice-7">
189+
<option value="standard">Standard: 7 day</option>
190+
<option value="rush" disabled="disabled">Rush: 3 days</option>
191+
<option value="express">Express: next day</option>
192+
<option value="overnight">Overnight</option>
193+
</select>
194+
</div>
195+
196+
197+
<h2>Optgroup support</h2>
198+
<p>If a select menu contains <code>optgroup</code> elements, jQuery Mobile will create a divider based on their <code>label</code> attribute:</p>
199+
200+
<div data-role="fieldcontain">
201+
<label for="select-choice-8" class="select">Choose shipping method:</label>
202+
<select name="select-choice-8" id="select-choice-8">
203+
<optgroup label="USPS">
204+
<option value="standard">Standard: 7 day</option>
205+
<option value="rush">Rush: 3 days</option>
206+
<option value="express">Express: next day</option>
207+
<option value="overnight">Overnight</option>
208+
</optgroup>
209+
<optgroup label="FedEx">
210+
<option value="sameday">First Overnight</option>
211+
<option value="sameday">Express Saver</option>
212+
<option value="sameday">Ground</option>
213+
</optgroup>
214+
</select>
215+
</div>
182216
</form>
183217

184218
</div><!-- /content -->

0 commit comments

Comments
 (0)