I have a datepicker which is used within the jQuery dialog object. The source of the dialog’s content is loaded using .load(). Within the dialog I created a script which creates a datepicker for the text input.
$("#date").datepicker({ ... });
When I open the dialog for the first time – everything is okay, but if I close it and reopen again, the datepicker is triggered automatically (and there’s no such an option like autoOpen:false)
Is there any way of preventing this or what am I doing wrong?
I had this exact problem and solved it with only a slight variation on tvanfosson’s technique. For some reason I had to manually attach the “click” event to the datepicker field as below.
(Sorry–I would’ve preferred to post this as a comment to tvanfosson’s post but don’t have the requisite rep.)