disabled in select option not working

Hi, I'm trying to create a listbox with 6 elements, the top one of which will be disabled (i.e. not clickable).

I'm including the 'disabled' parameter in the option statement, but it seems to ignore it.

It's in my HTML manual under both 'option' and 'select', it works ok under 'select', but I only want the ability to disabled individual list items.

This is my code...

<select name='fred' size=6>
 <option disabled>Title</option>
 <option value='2-1'>Free</OPTION>
 <option value='2-2'>Free</OPTION>
 <option value='2-3'>Free</OPTION>
 <option value='2-4'>Free</OPTION>
 <option value='2-5'>Free</OPTION>
</select>

But the first item in the list is not disabled, i.e. you can click on it..

Is this a disabled feature ??

I'm using IE5.
LVL 10
smeggheadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

crazyheadCommented:
Try "enabled='false'", or "disabled='true'". That might work.
0
knightEknightCommented:
<SCRIPT language='javascript'>
  var myndx = -1;
</script>

<select name='fred' size=6 onChange='if(this.selectedIndex==0){this.selectedIndex=myndx}else{myndx=this.selectedIndex}'>
   <option value='disabled'>Title</option>
   <option value='2-1'>Free</OPTION>
   <option value='2-2'>Free</OPTION>
   <option value='2-3'>Free</OPTION>
   <option value='2-4'>Free</OPTION>
   <option value='2-5'>Free</OPTION>
</select>
0
knightEknightCommented:
Add the style clause in the top option and it looks gray:

<SCRIPT language='javascript'>
 var myndx = -1;
</script>

<select name='fred' size=6 onChange='if(this.selectedIndex==0){this.selectedIndex=myndx}else{myndx=this.selectedIndex}'>
  <option value='' style='color=gray;'>Title</option>
  <option value='2-1'>Free</OPTION>
  <option value='2-2'>Free</OPTION>
  <option value='2-3'>Free</OPTION>
  <option value='2-4'>Free</OPTION>
  <option value='2-5'>Free</OPTION>
</select>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

knightEknightCommented:
BTW the code above works in both Netscape and IE
0
smeggheadAuthor Commented:
Thank You, I'll give it a go on Monday.. looks good though.
0
smeggheadAuthor Commented:
Thank you, and sorry about the delay.. (but I didn't say which Monday though - ha ha)

Don't suppose you know how to change the 'bgcolor' of an <option> do you ??
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.