• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts checkbox validation

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use "validwhen".

http://www.informit.com/guides/content.aspx?g=java&seqNum=286&rl=1
 
K Amin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic