I am creating a login page with the following input fields:
<td>
<s:textfield class="loginInput" name="username" label="Username" id="un1" size="20"/>
<s:password class="loginInput" name="password" label="Password" id="pw1" size="20"/>
</td>
However, when I compile and run the page, the two textboxes show up with different sizes. The Username textbox is slightly bigger than the password textbox.
I tried adding the size attribute to make them display the same length. I even tried adding a CSS element to have them display the same size, still nothing. Any suggestions?
Edit: I should add that this only happens in I.E. works perfectly fine in chrome
Which theme you are using? Since
sizeis a valid parameter of struts2 text-field. i suggest you to do following steps:Use simple theme:
If you have not set up a theme, Struts 2 uses the
"xhtml"theme by default. This means it will create additional HTML with<td><tr>for input elements out of the boxI hope this should work.
FYI: I tested your code in my local machine here is the screen shot and everything is working perfectly fine
Are you sure you are using your CSS and other things correctly??