I created jQuery UI datepicker as follows:
$.datepicker.setDefaults({ changeMonth: true, changeYear: true, defaultDate: null, dateFormat: dateTimeFormat, showOn: 'both', buttonImageOnly: true, buttonImage: urlPath + 'Content/styles/images/calendar.gif', buttonText: 'Calendar' }); $('input.datetime', controlContext).datepicker({ onSelect: function (dateText, inst) { $(inst, controlContext).val(dateText); var dateSelected = $(inst, controlContext).datepicker("getDate"); }, beforeShow: function (input, inst) { $('.hasDatepicker').blur(); } });
It works in all major browsers. It works fine on the iPad as well only if it is not in the jQuery dialog box. In the jQuery dialog box as well, if I use datepicker to just pick a date, it works fine. Only the drop-down list for choosing a month or date does not work at all. I see options for the drop-down menu and I can even click on any of the parameters, but it does not hide the list of options after selecting any parameters, it just stays there.
After a series of debugging, it turned out that the onchange event, which should fire when any month or year is selected, does not fire.
Repeat again, even the month / year selection works fine on the iPad if the datepicker is not in the jQuery dialog.
Not sure what is going wrong.
source share