I am displaying a jQuery UI dialog window that contains a jQuery UI datepicker control in it. The problem is that the first form field on the dialog window is the datepicker and thus it receives focus when the window opens up which in turn causes the datepicker window to automatically open. I don't want this to occur.
I have tried calling
$('#Date').datepicker('hide')
in then open function of the dialog window and also after the code that makes the dialog open but it doesn't work as when that code is reached, the datepicker window isn't open yet.
How can I make it so that the datepicker window doesn't open when the dialog window shows up but still have it open when the user clicks on the input?