admin管理员组文章数量:1225543
<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 via a click event:
$('#yup').live('click', function () {
$('#name').text($('#selectedSponsorName').text());
$("#newSwitchDialog").dialog('open');
});
The datepicker automatically pops open for the first input. How do I make it not do that? Only option I found was to set it to open on a button click, but I couldn't find any autoOpen
sort of thing.
Thanks.
<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 via a click event:
$('#yup').live('click', function () {
$('#name').text($('#selectedSponsorName').text());
$("#newSwitchDialog").dialog('open');
});
The datepicker automatically pops open for the first input. How do I make it not do that? Only option I found was to set it to open on a button click, but I couldn't find any autoOpen
sort of thing.
Thanks.
Share Improve this question edited Jan 19, 2012 at 22:50 Andrew Whitaker 126k32 gold badges295 silver badges308 bronze badges asked Oct 28, 2011 at 18:26 slandauslandau 24.1k43 gold badges124 silver badges186 bronze badges1 Answer
Reset to default 18Try setting the tabindex
attribute on 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/
本文标签: javascriptJquery DatePicker set to not autoopenStack Overflow
版权声明:本文标题:javascript - Jquery DatePicker set to not auto-open - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739395592a2161375.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论