views:

80

answers:

0

Hi, I'm using jQuery.datepicker and jQuery.validate. In my form I have multiple date ranges:

2010-02-10 - 2010-02-18
2010-03-01 - 2010-03-12
2010-03-15 - 2010-03-19

etc.

Now I need to validate the datepicker field to check if the date set in the datepicker is between any of those date ranges. For instance 2010-01-01 would be invalid, as would 2010-02-19.

I've seen some answers but they don't really relate to multiple ranges, as far as I can see.

Hope anyone know a solution, or at least can hint me in the right direction. I'm thinking maybe looping each daterange in an .each() and running a validation in there. But there is probably a better way.