sasalabelle
New Member
I want my error message to the right side of my field. However when the password field has an error, the error message of the password is on the right side of the userName field. Why does it behave that way? base on the w3schools my format is correct. The error message password not correct should be on the right side of the password field.This is the pattern I am following inside my form.\[code\]<table border="1"> <tr> <td>UserNAme</td> <td>UserName Error message</td> </tr> <tr> <td>Password</td> <td>Password Error Message</td> </tr> </table>\[/code\]This is my Struts2 Code.\[code\]<!--Struts2 log-in--> <s:form method="POST" action="login" theme="simple" > <table border="1" > <tr> <td> UserName:<s:textfield label="UserName" key="userName" maxLength="20"/> </td> <td class="errorMessage"> <sroperty value="http://stackoverflow.com/questions/13832469/fieldErrors.get('userName').get(0)" /> </td> </tr> <tr> <td> PassWord:<sassword label="Password" key="password" maxLength="20"/> </td> <td class="errorMessage"> <sroperty value="http://stackoverflow.com/questions/13832469/fieldErrors.get('password').get(0)" /> <td> </tr> <tr> <td> <s:submit value="http://stackoverflow.com/questions/13832469/Login" align="center"/> </td> </tr> </table> </s:form>\[/code\]This is the html result of the struts.\[code\]<!--Struts2 log-in--> <form id="login" name="login" action="/springtest/login.action" method="POST"> <table border="1" > <tr> <td> UserName:<input type="text" name="userName" maxlength="20" value="http://stackoverflow.com/questions/13832469/tok" id="login_userName"/> </td> <td class="errorMessage"> </td> </tr> <tr> <td> PassWord:<input type="password" name="password" maxlength="20" id="login_password"/> </td> <td class="errorMessage"> Password must not be blanks. <td> </tr> <tr> <td> <input type="submit" id="login_0" value="http://stackoverflow.com/questions/13832469/Login"/> </td> </tr> </table> </form>\[/code\]