You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Lea <ja...@kumachan.net.nz> on 2004/01/18 01:27:09 UTC

Re: how to disable a html:option tag?

It could be that the the tag just renders an <option value="somevalue" 
disabled="true">sometext</option> html tag.  If that is the case then 
the HTML browser would need to support the disable attribute.  I wrote a 
quick test for IE and Mozilla:

<html>
<body>
<form>
<select name="x">
<option value="1">1</option>
<option value="2" disabled="true">2</option>
<option value="3">3</option>
</select>
</form>
</body>
</html>

IE V6.0 didn't support the disable attribute.  Mozilla Firebird V0.7 does.

Hookom, Jacob wrote:

>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:me@dirkmanske.de] 
>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:servicerespond.dirkmanske@nexgo.de] 
>Gesendet: Freitag, 16. Januar 2004 18:04
>An: struts-user@jakarta.apache.org
>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: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>


-- 
Jason Lea



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


AW: how to disable a html:option tag?

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
Hi,

thank you all for your help. The final explanation was brought by Jason. The
special disabled attribute only works with mozilla browsers!!! I justt
tested it.  ie6 indeed does not support the thml:option disable attribute
(sh...). Unfortunately I am not allowed to use mozilla... so the javascript
example comes in... :) 

Dirk 

-----Ursprüngliche Nachricht-----
Von: Jason Lea [mailto:jason@kumachan.net.nz] 
Gesendet: Sonntag, 18. Januar 2004 01:27
An: Struts Users Mailing List
Betreff: Re: how to disable a html:option tag?

It could be that the the tag just renders an <option value="somevalue" 
disabled="true">sometext</option> html tag.  If that is the case then the
HTML browser would need to support the disable attribute.  I wrote a quick
test for IE and Mozilla:

<html>
<body>
<form>
<select name="x">
<option value="1">1</option>
<option value="2" disabled="true">2</option> <option value="3">3</option>
</select> </form> </body> </html>

IE V6.0 didn't support the disable attribute.  Mozilla Firebird V0.7 does.

Hookom, Jacob wrote:

>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:me@dirkmanske.de]
>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:servicerespond.dirkmanske@nexgo.de]
>Gesendet: Freitag, 16. Januar 2004 18:04
>An: struts-user@jakarta.apache.org
>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: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>


--
Jason Lea



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org