I have 2 fields on my jsp: start date and end date. I have to put some validation that the startDate user enters in always less than or equal to the end date. (I have myAction which extends ValidatorForm. I am using validation.xml to put required field check.)
It sounds like you already know how to do validating for your ActionForm. What part exactly are you having problems with? Also, have you read the Struts documentation on build in validators for the ValidatorPlugin?
you need to write your own custom validation. look for samples online. the most common example you'll find is the validate identical (eg. if the user entered the same password for 2 fields). base on that example, you can do your date compare validation.
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Joined: Oct 22, 2002
Has anybody done this before? Could you please point me to some useful information on what I am looking for.thanks.
Originally posted by vinod: Write a small function for testing if the first date is greater than the second one. then add the error to action error object.(valErrors.add("date", new ActionError("errors.date"));
We don't have many rules here, but we do have a naming policy which we try to strictly enforce. Please re-read this document and edit your display name in order to comply.