A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
Struts2 <s:form> includes empty <td>
Saravanan Vijayappan
Ranch Hand
Joined: Jan 02, 2007
Posts: 47
posted
May 09, 2009 21:43:21
0
Empty TD is included in struts2 form. Please have a look at the below my
JSP
code snippet below.
<body> <s:form> <tr> <td > Are you ${session.user['firstName']} ? </td> </tr> <s:radio list="#{'true':'Yes','false':'No'}" name="isUser"></s:radio> <s:submit align="center" cssClass="button" value="submit"/> </s:form> </body>
Generated html code in browser is below for the above code
<body> <form> <table class="wwFormTable"> <tr> <td > Are you Shan ? </td> </tr> <tr> <td class="tdLabel"></td> <td> <input type="radio" name="isUser" id="Login_isUsertrue" value="true"/><label for="Login_isUsertrue">Yes</label> <input type="radio" name="isUser" id="Login_isUserfalse" value="false"/><label for="Login_isUserfalse">No</label> </td> </tr> <tr> <td ><div align="center"><input type="submit" id="Login_0" value="submit" class="button"/></div></td> </tr> </table> </form> </body>
Why this line of empty <td> is generated ? - <td class="tdLabel"></td>
I really could not find out a way to get rid of this <td> ? Could any one please help me?. Thanks
Cheers,<br />Sarav
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
May 10, 2009 05:15:51
0
Because you have no label for your radio button.
The default theme, "xhtml", puts form elements in tables. You may want to read some of the S2 documentation regarding themes and templates.
Saravanan Vijayappan
Ranch Hand
Joined: Jan 02, 2007
Posts: 47
posted
May 10, 2009 06:34:57
0
Thank you., that helped me, I am going to use theme="simple" and manually going to create <table>
I agree. Here's the link:
jrebel
subject: Struts2 <s:form> includes empty <td>
Similar Threads
document.forms[0].submit(); throws Invalid Argument in IE
iterate problem in struts2
Jsp is not displaying in Struts2
How to "enable/disable" radio button in struts2 on click of check box
unable to do validation for select in struts2
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter