Double Calendar to text box

I would like to attach a double calendar to a text box. What I would like is to allow users to see two months (Current and the next).

I have the following code and want to have two double calendars attached to these boxes:















Depart
Return




I have managed to get a single calendar but am not able to get double calendar. If I can verify the retun date to be later than depart date it will be really great.



Any sort of help is really appreciated.

Please check attached sample.
1227027674.zip (35 KB)

Thank you very much for your reply. On the first look it seems to work perfectly fine. But if you notice you will see that the date in the text box after clicking is always the first default Date.
For example in your files you have set the from date as 06/01/2008 so the first time the script will always display this text no matter where the user clicks. Even if I click on 21/01/2008 the text box will have value: 06/01/2008.
The same applies to the right calendar.

Also can we have two months instead of the same month? like in this case the first month will be 01/2008 and the right will display 02/2008. And then can we also have two sets of calendars? One for the depart date and one for the return date instead of using the same calendar for both the fields?

Im sorry troubling you but i really am a novice and understand 000000 about javascript coding :frowning:

Thanks once again.

The same applies to the right calendar.
Yep, I missed this point, fixed sample attached to the post.


>>like in this case the first month will be 01/2008 and the right will display 02/2008.
of course, the buttons on calendar allows to select any months.
starting values defined in js code by
mDCal.setDate(“06/01/2008”,“15/01/2008”)
can be changed to the
mDCal.setDate(“01/01/2008”,“01/02/2008”)

>>And then can we also have two sets of calendars?
You can use the same code to create one more calendar and attach it to the necessary inputs.

3849238.ZIP (35.4 KB)

Yes now the dates are coming fine. Thank you so much.

I guess I have not been very clear: What currently is happening is: When user clicks on the Depart text box the double calendar comes that allows users to select the depart date from the left calendar and the return date from right calendar.
This wont work for me because I want user to be able to select a depart date from either the left or the right calendar. Then when user clicks on Return text box another double calendar comes up and user can select a date from either the left or the right calendar.
Hope this clears what Im looking for.

Thank you very much.


dblCalendar is not purposed for such use-case.
It still can be used ( sample attached ) for such scenario, but it is far from perfect.



934729.ZIP (35.4 KB)