Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

using css style within s:form

Jeffrey Hau

2007-02-01


Hi,
In my s:form element, i would like to show a textinput box only if
certain value is selected in the s:select element. Using the code
below, although the s:textfiled is enclosed in a div with "display:
none", the textfield it still displayed on the page.

<s:form action="doUpload" method="POST" enctype="multipart/form-data">
   <s:select id="accessInput" name="access" list="{'public',
'private', 'group'}"/>
   <div id="groupInput" style="display: none;">
     <s:textfield name="group"></s:textfield>
   </div>
</s:form>

(I have also tried replacing div with s:div and style to cssStyle)

I have tried moving the div out of the s:form element then it works
fine. Is the s:form element overwriting the css style of the div tag?
Anyone knows how to solve this problem?

many thanks

Jeff

©2008 junlu.com - Jax Systems, LLC, U.S.A.