1

jQuery 1.7.2 jQuery UI 1.8.18

I have a jQuery UI Modal Dialog that contains a jQuery UI Datepicker. This is a pop up editor we are using with our app. The first time the user pops up the editor everything works fine including the Datepicker. After that when the editor is poped - the Datepicker shwos up when the icon is clicked but selecting a date will not change the values in the associated input tag as it should (and did the first time).

Since the Dialog seems to cache I have tried both versions of assigning the Datepciker below (with this and without this) - both function exactly the same - works on first pop up then will not select the new date.

    $(function () {
    $("#txtTrxTravelDate", this).datepicker({
        changeMonth: true,
        changeYear: true,
        showOn: "button",
        buttonImage: "../Images/calendarSm.gif",
        buttonImageOnly: true
    });
});

    $(function () {
    $("#txtTrxTravelDate").datepicker({
        changeMonth: true,
        changeYear: true,
        showOn: "button",
        buttonImage: "../Images/calendarSm.gif",
        buttonImageOnly: true
    });
});
5
  • please provide code and if possible a jsfiddle Commented Feb 26, 2013 at 14:39
  • Are you sure that there is only one element with the ID used by the Datepicker to populate the date? It seems like some elements are created each time you are opening a modal dialog popup.
    – sdespont
    Commented Feb 26, 2013 at 14:50
  • Added some code examples above. And yes - there is only one element with the id of "txtTrxTravelDate" on the page.
    – Jim Evans
    Commented Feb 26, 2013 at 14:55
  • Please provide a jsfiddle example
    – Dom
    Commented Feb 26, 2013 at 15:07
  • I would love to provide a jsfiddle example but in this case not really applicable - we are wired up to data being passed in and log in - security and a few leading pages to get into the state of the application where this occurs. I have debugged through all of that and the data is being passed to the pop up correctly - the Datepicker just does not change the date on the second pop up instance..
    – Jim Evans
    Commented Feb 26, 2013 at 15:12

0