Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Joined: Nov 02, 2004
Jul 13, 2006 12:30:00
I have a situation to use valid when/requiredif.When number of years at address is less than 2 yrs i have to validate previous address.
This is the entry i have in validation.xml
<field property="prevAddressLine1" depends="required, requiredif">
<var-value>((numYrsAtAddr != " Less Than 24 Months"))</var-value>
prevAddressLine1 refers to form2 and numYrsAtAddr refers to form1. Is there any way i can do this??
Joined: Apr 25, 2005
Jul 13, 2006 16:22:00
When you want to create your own validation rules, then you can use apache's common-validation project. common-validation jar already comes with your
The advantage which validation rules give is that you can reuse same rule for different form on fly without rewriting sam logic again and it promotes reusability.
Thing which is not clear
When number of years at address is less than 2 yrs i have to validate previous address.
When the entered value of someTextField is less than 2 yrs, then you want to trigger some validation routine and want to show error message.
Is it your problem?
Asking Smart Questions FAQ
How To Put Your Code In Code Tags
It is sorta covered in the
JavaRanch Style Guide
subject: validWhen help!!
Validate multiple fields base on a requiredif
validation in tomcat 4.1
Struts validation with minlength
problem in using validator framework with multiple screen jsps
Help with validation rules for form with multiple submit buttons
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013