I have a modal dialog being opened when a user clicks a button:
Inside this modal is a form and one form element is a text input that gets updated by a jquery datepicker object:
The datepicker works fine the first time the modal is opened and then the form submitted (after which the modal closes). However, if I click the button to open the modal a second time, clicking on the button to open the datepicker causes the following error in the console:
This error is said to be in jquery-ui-1.8rc3.custom.min.js
I'm assuming this means that the datepicker is not getting created a second time when I click to open the modal, but I'm not really sure.
I've tried putting the creation of the datepicker inside the .click function for the button to bring up the modal and I get the same behavior; works once and throws the error the second time.
Why is this error being thrown on the second use of the datepicker in the modal?
This happens in IE 8, FF, and Chrome
The modal plugin being used is http://www.ericmmartin.com/projects/simplemodal/