The moose likes Struts and the fly likes struts checkbox validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts checkbox validation" Watch "struts checkbox validation" New topic

struts checkbox validation

K Amin

Joined: Oct 11, 2007
Posts: 8
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

Joined: May 05, 2006
Posts: 181
Use "validwhen".

K Amin

Joined: Oct 11, 2007
Posts: 8
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

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

I agree. Here's the link: http://aspose.com/file-tools
subject: struts checkbox validation
Similar Threads
Struts two filed comparison
problem in name and password fields validation
Check Box
JSF validations using validator method?
How to make text fields appear when checkbox is selected