View Full Version : question about select tag

07-14-2008, 09:57 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.


07-14-2008, 10:38 AM
<select name="mylist" disabled="disabled">
<option >1</option>
<option selected="selected">Select Category</option>
<option >3</option>
</select> should work in both!

07-14-2008, 10:43 AM
Just make it your first option. Drop the "selected", as its not needed, and drop disabled too, as that (i presume) makes it unselectable (and therefore, not the first option on the list). Use whatever scripting language you know to validate form input.