Click to See Complete Forum and Search --> : question about select tag


sudhakararaog
07-14-2008, 05:01 AM
I would like an option in the select tag not to be selected by default but appear as the first option when the file is loaded. i have used the following code

<option disabled="disabled" selected="selected">Select Category</option>

however this works in firefox but not in Internet Explorer how can i change the above code to work in both the browsers

please advice.

thanks.

bradgrafelman
07-14-2008, 02:25 PM
Why not just place a normal OPTION element right after the SELECT tag, and then add the "selected" attribute to the second?

<select name="foobar">
<option value="">Select Category</option>
<option selected="selected" value="c1">Category #1</option>
<!- ... ->
</select>