• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

option disabled="true" does not work in IE

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to disable an <option> of <select> in IE.

<select name="selectionA" onchange="this.form.submit()">
<option disabled="true">Select one of these</option>
<option>AAAA</option>
<option>BBBB</option>
</select>

This does not work. Is there any other way of doing this.
Thanks,
Gayatri
 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If nothing else works, you can always "disable" it with javascript: whenever the select value changes, change it back if it's the disabled one.

-Yuriy
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
But I do not understand :

"change it back if it's the disabled one"

I can't disable <option> in IE.


Thanks.
Gayatri

If nothing else works, you can always "disable" it with javascript: whenever the select value changes, change it back if it's the disabled one.
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Something like this:
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if the disabled attribute is to be used this way then why not just compare for the index of the option.
Will save the trouble of putting disabled and then checking if disabled or not.
just compare the selectedIndex.
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THanks everyone for the replies.
 
reply
    Bookmark Topic Watch Topic
  • New Topic