I found this solution searching in google:
(http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20756860.html)

[copy of that solution...]
<html>
<form >
<select onChange="if(this.options[this.selectedIndex].state=='disabled')
this.selectedIndex=0">
<option value="1" state="enabled">one</option>
<option value="2" state="enabled">two</option>
<option value="3" state="disabled"
style="background-color:silver">three</option>
<option value="4" state="disabled"
style="background-color:silver">four</option>
</select>
<input type="submit">
</form>
</html>

When you select disabled option it defaults to first one.

Buy the way, you shouldn't show disabled options in the select, that
would be a nicer solution, rather than previous one.

Cheers.
Guillermo

-----Original Message-----
From: Hookom, Jacob [mailto:[EMAIL PROTECTED] 
Sent: Sábado, 17 de Enero de 2004 09:12 p.m.
To: Struts Users Mailing List
Subject: RE: how to disable a html:option tag? 
Sensitivity: Personal


You can disable the select tag as a whole, but I've never heard of
disabling an option tag.  You might just want to not list them.

-----Original Message-----
From: Dirk Manske [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 17, 2004 5:21 PM
To: 'Struts Users Mailing List'
Subject: AW: how to disable a html:option tag? 
Sensitivity: Personal

Hi,

Does nobody know an answer or is it just too trivial?! Hm. The HTML Tag
Library says, that I can disable an option by setting disabled to
"true". However it does not work, the option can still be selected. I am
wondering is this a bug or did I miss something?

I hope someone can give me a hint. Thank you.

Dirk
 

-----Ursprüngliche Nachricht-----
Von: Dirk Manske (Service Respond)
[mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 16. Januar 2004 18:04
An: [EMAIL PROTECTED]
Betreff: how to disable a html:option tag? 
Vertraulichkeit: Persönlich

Hi,
 
I have in a form a html:select tag and inside some html:option tags. I
want to disable some options and declared it like this
 
<html:select ...>
 
<html:option value="1" disabled="true">optionText</html:option>
 
</html:select>
 
But this seems not to work because this option is still selectable. How
to solve it?
 
thx,
Dirk


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to