Hi all,

I got it working using the fieldexpression validator. 

<field-validator type="fieldexpression">
    <param name="expression">
        firstDate.before(secondDate) || firstDate.equals(secondDate)
    </param>
    <message>Second date has to be on or later than first date</message>
</field-validator>              

Posting this here so that it might be helpful to someone. Please see
http://struts.apache.org/2.0.6/docs/fieldexpression-validator.html - not
sure why I missed it!

Thanks,
Binil


Binil Thomas wrote:
> 
> Hi all,
> I searched the archives on this, but could not find an answer - hence I am
> posting it here.
> 
> I have two date fields on my form. I want to validate that the first is
> always on or before the second. I want the error message to show next to
> the second date field. 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Validating-two-dates-tf3406568.html#a9532016
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to