Devine Posted August 13, 2007 Share Posted August 13, 2007 Ok so I want it to show text to seperate certain options.. this would be the drop down list: OPTIONS 1 option 1 option 2 option 3 OPTIONS 2 option 1 option 2 OPTIONS 3 option 1 option 2 option 3 I want to make it so the capitalized "options" cannot be chosen in the select field.. I know its possible, any help? Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 13, 2007 Share Posted August 13, 2007 Try using javascript. if (document.form.OPTIONS_1.select == selected){ alert("You cannot select that."); } Quote Link to comment Share on other sites More sharing options...
gurroa Posted August 13, 2007 Share Posted August 13, 2007 I'm using this and later when proceeding form check wheter is foo not empty. It's because IE users are still able to select disabled option. <select name="foo" onchange="if(this.value=='')this.value=1;"> <option value="1">Option 1 <option disabled value="" style="color: gray">Option 2 <option value="2">Option 3 </select> Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 13, 2007 Share Posted August 13, 2007 <option disabled value="" style="color: gray">Option 2 Should be, <option disabled="disabled value="" style="color:gray">Option 2 Quote Link to comment Share on other sites More sharing options...
gurroa Posted August 13, 2007 Share Posted August 13, 2007 See http://www.w3.org/TR/html4/interact/forms.html#edef-OPTION. Besides this parameter doesn't work in IE browser. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 13, 2007 Share Posted August 13, 2007 is this not a case for <optgroup> ?? http://www.w3schools.com/tags/tag_optgroup.asp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.