Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts checkbox validation

 
K Amin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me with this kind of valadition which has a checkbox and 2 password input fields, if the checkbox is checked then password filds are required otherwise not. For other forms in this application I am using client-side validation.

Thanks in advance
 
Dom Lassy
Ranch Hand
Posts: 181
 
K Amin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lassy,

I have been trying to use "validwhen" but I couldn't get it work. I am sending you the code, if you can help me what to write in validation.xml that will be great

<tr>
<td><bean:message key="label.changepassword"/></td>
<td><html:checkbox property="changePassword" /></td>
</tr>
<tr>
<td><bean:message key="label.password"/></td> </td>
<td><html assword property="password" /></td>
</tr>
<tr>
<td><bean:message key="label.passwordagain"/></td>
<td><html assword property="passwordagain" /></td>
</tr>

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic