Hi all,
Iām building a web to book a common room.
It has a form with a begin date field and an ending date field.
You can add as many beginning dates an ending dates as you want.
When the data is submitted I have an array with all the beginning dates and another array with all the ending dates.
To clarify:
Begin dates Ending dates
01-07-2013 03-07-2013
04-07-2013 10-07-2013
arrayBeginDates ["01-07-2013","04-07-2013"]
arrayEndDates ["03-07-2013","10-07-2013"]
The way the arrays a formed in my code:
var arrayBeginDates = [];
$(".beginDate").each(function(){
arrayBeginDates.push($(this).val());
})
//and the same for ending dates, arrayEndDates
I need to validate that in the pairs begin-end dates the end date is greater than the begin date.
Meaning:
arrayEndDates [0] has to be greater than arrayBeginDates [0] otherwise error alert and exit arrayEndDates [1] has to be greater than arrayBeginDates [1] otherwise error alert and exit
and so on
How can I do that??
Thanks a ton!