JQuery DatePicker is not set to open automatically
<div id="newSwitchDialog"> <span id="name"></span><br /><br /> <table> <tbody> <tr> <td>Effective Date: </td> <td><input type="text" id="startDate" /><br /></td> </tr> <tr> <td>End Date: </td> <td><input type="text" id="endDate" /></td> </tr> </tbody> </table> </div> When I open this dialog with a click event:
$('#yup').live('click', function () { $('#name').text($('#selectedSponsorName').text()); $("#newSwitchDialog").dialog('open'); }); The date sensor automatically opens for the first entry. How can I do this wrong? The only option I found was to set it to the click button, but I could not find something like autoOpen .
Thanks.
+7
slandau
source share1 answer
Try setting the tabindex attribute in the fields containing the datepicker widget to -1 :
<input type="text" id="startDate" tabindex="-1" /> (same for endDate )
Before: http://jsfiddle.net/NzfwD/
After: http://jsfiddle.net/pyJUR/
+15
Andrew Whitaker
source share