File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts checkbox validation" Watch "struts checkbox validation" New topic
Author

struts checkbox validation

K Amin
Greenhorn

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".

http://www.informit.com/guides/content.aspx?g=java&seqNum=286&rl=1
K Amin
Greenhorn

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

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