You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by red phoenix <ro...@gmail.com> on 2010/03/14 06:40:17 UTC

legend don't work under of struts2

I want to use legend tag under struts2,I set legend css like follows:
form{
padding:10px;
margin:0 auto;
}
form#form legend {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x center left;
color:#a43708;
}

following code can run well:
<h3 id="adduser" style="width:100%;">Add user</h3>
<form id="form">
  <fieldset id="personal">
     <legend>information</legend>
  </fieldset>
</form>

Then I use <s:form> to replace <form> tag,like follows:
<h3 id="adduser" style="width:100%;">Add user</h3>
<s:form id="form">
  <fieldset id="personal">
     <legend>information</legend>
  </fieldset>
</s:form>

Then I find legend tag don't work! Why? How to correct above code to
make legned tag run again?

Thanks

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


Re: legend don't work under of struts2

Posted by Alex Rodriguez Lopez <al...@flordeutopia.pt>.
Hi!

This might be related to the theme the form is using, 
http://struts.apache.org/2.1.8.1/docs/themes-and-templates.html

This happened to me too, the default s2 theme adds table elements to 
forms for layout, and trying to use fieldsets results in them being 
rendered apart from the form elements they group. You could try using 
simple theme and doing all the styling yourself with css the way it 
should be done. I think you can specify to use simple theme at whole 
page, form or element level.

Em 14-03-2010 05:40, red phoenix escreveu:
> I want to use legend tag under struts2,I set legend css like follows:
> form{
> padding:10px;
> margin:0 auto;
> }
> form#form legend {
> border:1px solid #e8e7e1;
> background:#fff url(../img/form_red.gif) repeat-x center left;
> color:#a43708;
> }
>
> following code can run well:
> <h3 id="adduser" style="width:100%;">Add user</h3>
> <form id="form">
>    <fieldset id="personal">
>       <legend>information</legend>
>    </fieldset>
> </form>
>
> Then I use<s:form>  to replace<form>  tag,like follows:
> <h3 id="adduser" style="width:100%;">Add user</h3>
> <s:form id="form">
>    <fieldset id="personal">
>       <legend>information</legend>
>    </fieldset>
> </s:form>
>
> Then I find legend tag don't work! Why? How to correct above code to
> make legned tag run again?
>
> Thanks
>
> ---------------------------------------------------------------------
> 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