I am creating a site so as the visitor can select a date of arrival and departure.After selecting a date in the arrival field I want the dates in the departure field before the arrival date to be disabled? I have looked in the documentation but could not find a solution.Any help is welcome?
Asked
Active
Viewed 364 times
1 Answers
1
In the keith-wood site, select the 'Min/Max' tab and take a look at the 3rd example, which is called 'Seven days ago to 30 days ahead'. Take a look at the code snippet; you should set the minDate to -0, so user won't be able to select yesterday. In my opinion, you should always disable yesterday.
Hopefully, this gets you going.
Please check the two threads below (from Stackoverflow), both provide solutions for the problem you have:
end-date-greater-than-start-date-jquery-validation
jquery-bassistance-validate-that-end-date-is-after-start-date
-
I know this.My problem is that there are two input fields of dates.One is arrival and one is departure.Someone cannot go before they come.So i want the departure date to be always later than the arrival date.The disabling of the dates in the departure date should be relative to the value in the arrival date field i.e. disabling of the departure date should happen after a date is chosen for arrival.I hope I have made myself clear enough.Thank for the help in advance. – Narendra Chitrakar Mar 12 '12 at 05:47
-
Hi Narendra Chitrakar, I added new info to my answer with two links to similar question asked here before. – utsikko Mar 12 '12 at 07:30