stevengreen
asked on
DropDownList plain HTML
Hi Guys,
What is the code for putting a separator in a select/option box (dropdownlist). I've come accross it once, but forgot to save it. It's something more intellegent than putting <option>----------</option > in the select.
Any help would be greatly appreciated.
thanks
Stevengreen
What is the code for putting a separator in a select/option box (dropdownlist). I've come accross it once, but forgot to save it. It's something more intellegent than putting <option>----------</option
Any help would be greatly appreciated.
thanks
Stevengreen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This might be helpful:
<SELECT NAME=browser>
<OPTION>1</OPTION>
<OPTION>2</OPTION>
<OPTION disabled="disabled">—————</OPTION>
<OPTION>A</OPTION>
<OPTION>B</OPTION>
</SELECT>
Only in FF
Alternative is
Alternative is
<SELECT NAME=browser onChange="if (this.options[this.selectedIndex].value=="---") this.options[this.selectedIndex-1].selected=true">
<OPTION>1</OPTION>
<OPTION>2</OPTION>
<OPTION value="---" disabled="disabled">—————</OPTION>
<OPTION>A</OPTION>
<OPTION>B</OPTION>
</SELECT>
or
<SELECT NAME=browser onChange="if (this.options[this.selectedIndex].value=="---") this.selectedIndex--;">
ASKER
Not quite what i was looking for. I need to apply an <optgroup> to a dropdownlist in asp.net. Sorry I did put this in the wrong group ;-)
Thanks
Stevengreen