struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance <lance.semm...@marketpipe.com>
Subject Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.
Date Wed, 18 Apr 2007 14:56:06 GMT
Another option is to make a disabled style in your css and blur onfocus

<html:select property="id" styleClass="disabled" onFocus="this.blur()">
:
</html:select>

Using a hidden element with the same name is slightly dodgy in that 
form.elements["id"] will return a different value depending if the 
hidden element is placed before or after the select.

Megani wrote:
> Hey, i was having the same problem...
> i needed a <html:select that was read-only, but it had to forward it's id 
> to the action servlet populate the form bean with it.
>
> i just declared a <html:hidden with the same property after it.
>
> like:
>
> <html:select property="id" disabled="true"  >
> (...)
> </html:select>				
>
> <html:hidden property="id"/> 
>
> works fine ;)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


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


Mime
View raw message