h1

Making Non-selectable options and option groups in select

December 10, 2010

Making Non-selectable options and indented option groups are pretty easy in select control. disabled the options is not a correct way to do, use optgroup option.

Making Non-selectable options :

<select >
<option >groups</option>
<optgroup label=”group1″> </optgroup>
<option> group 1 item 1</option>
<option> group 1 item 2</option>
<optgroup label=”group2″> </optgroup>
<option> group 2 item 1</option>
<option> group 2 item 2</option>
</select>

Making indented option groups:

<select >
<option >groups</option>
<optgroup label=”group1″>
<option> group 1 item 1</option>
<option> group 1 item 2</option>
</optgroup>
<optgroup label=”group2″>
<option> group 2 item 1</option>
<option> group 2 item 2</option
>/optgroup>
</select>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: