You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Renato Romano <r....@set-network.com> on 2003/03/12 15:45:30 UTC

Html:options

Is there a way of obtaining a <select> element where one of the <option>
sub-elements has the SELECTED attribute ?
Thanks

____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA

e-mail: r.romano@set-network.com
Tel.:   010 2712603
_____________________________________




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


Re: Html:options

Posted by Nicolas De Loof <ni...@cgey.com>.
if you use <html:select> with <html:option> or <html:options>, the
option that equals the formbean property value will be automaticaly
selected.

(formbean initialized with name="foo")

<html:select property="name">
    <html:option value="foo">foo</html:option>
    <html:option value="bar">bar</html:option>
    <html:option value="nop">nop</html:option>
</html:select>

will render
<option value="foo" selected>

Nico.


> Is there a way of obtaining a <select> element where one of the
<option>
> sub-elements has the SELECTED attribute ?
> Thanks
>
> ____________________________________
> Renato Romano
> Sistemi e Telematica S.p.A.
> Calata Grazie - Vial Al Molo Giano
> 16127 - GENOVA
>
> e-mail: r.romano@set-network.com
> Tel.:   010 2712603
> _____________________________________
>
>
>
>
> --------------------------------------------------------------------
-
> 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