This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Sorry, jayanthi, you can't disable a single option in a select box. The entire select box is either enabled or disabled.
If you need to make sure a user doesn't select a specific option, you have two choices:
Disabled is attribute of struts html's option tag. This attribute is not available for options & optionsCollection tag's. The biggest trouble is option disabled attribute is not browser compatible. IE does not support disabled attribute for select element where as Firefox supports it.
If you want to disable the options then you have to use logic:iterate, logic:equal and html: option together to disable certain options.
Joined: Feb 15, 2005
Thanks, Purushothaman. I learned something new today. I'll have to play around with Firefox's support of disabling a single option.
It's great that Firefox supports it, but the fact that the most popular browser does not support it seems like a pretty big drawback to me. Unless you are writing an intranet application where Firefox is the only browser supported, I wouldn't use it. [ July 31, 2006: Message edited by: Merrill Higginson ]