I attach the datepicker to inputs in a global script file with like this:
$(document).on("focusin",".datePick", function () {
$(this).datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
onClose: function () { $(this).valid(); }
});
});
On a specific page, there are inputs(which will be used with datepicker) in a modal dialog(also jquery ui) and I call that page via $.load() and inject into a div in other page.
The code above works very well for static inputs in other pages but for the scenerio above, it shows the datepicker dialog fine but when I click on a date, it throws error(f is undefined)Edit: VS2010 throws "Unable to set value of the property 'currentDay': object is null or undefined"
Some people suggested to use live() method, but I dont want to use deprecated method.. What should I do about the issue?
Thanks in advance
Ozgu