so I’m using the jQuery UI datepicker and have gone through the documentation but still cannot customize the calendar to my needs.
I’m trying to disable the previous months – only the current and future months need to be shown.
I’d like the past days in the current month to be “unselectable” - they should still be visible, perhaps of a lighter colour but they cannot be selected.
Please let me know if you can assist me with this.
I got the minDate working, not so difficult after all.
Now I’d like to display some default text (placeholder text) in the input such as “check-in”, which disappears when the input is clicked or when the input receives the dates from the datepicker.
Or are you looking for something to give the user a clue as to what the field is for? You may need to use a HTML label tag with a “for” attribute. The “for” attribute is to connect the label field with the input. So, when a user clicks on the label, their cursor automatically focuses in the field with that ID.
please excuse the late reply - I didn’t know that I had received more replies to my thread.
Can’t you just use HTML5’s placeholder attribute, or am I missing something?
I’m using HTML 4 so not sure if that would work.
Or are you looking for something to give the user a clue as to what the field is for?
Yes, something like “check-in”, and perhaps I can save some space instead of having a label before the input field.
A bigger problem I found is that it’s possible to select a starting date such as 1 March 2014 and then an end date such as 20 January 2014, which clearly won’t work…
use the onSelect method. Then, for the starting date, when it is selected, set date as the minDate for the ending date. For the ending date, when it is selected, set the maxDate for the starting date.