Forums

js validation for comparing two dates from two datepickers

resh123 17 Sep, 2012
hello,
I am using chronoform v4 and joomla 1.5.I have two datefields in my form say date1 and date2.Now i want date1 to be greater than the current date and date2 greater than the date1.
Please tell me how to write the custom javascript.
GreyHead 17 Sep, 2012
Hi resh123,

The simplest answer may be to use the datepicker 'range' option see this FAQ.

You can set the minDate option to set a minimum date; this can be set to be greater than today for the first datepicker. It's probably also possible to have the minDate for the second datepicker linked to the date selected in the first one but you'd need to write some custom script :-( There may be a solution in the forums but I don't remember it.

Bob
This topic is locked and no more replies can be posted.