我正在使用带有datepicker的JQuery ui,当用户选中某个字段时,他们会适当地弹出日历.
这是代码.(也可以设置标签索引)
<input type="text" name="demo" />
<input type="text" class="date" />
Run Code Online (Sandbox Code Playgroud)
jquery代码是:
$(".date").datepicker();
Run Code Online (Sandbox Code Playgroud)
关于我如何解决这个问题的任何建议(最短的解决方案的奖金)?
cll*_*pse 39
订阅onClose
或onSelect
活动:
$("#someinput").datepicker(
{
// other options goes here
onSelect: function ()
{
// The "this" keyword refers to the input (in this case: #someinput)
this.focus();
}
});
Run Code Online (Sandbox Code Playgroud)
或者在以下情况下onClose
:
$("#someinput").datepicker(
{
onClose: function ()
{
this.focus();
}
});
Run Code Online (Sandbox Code Playgroud)