gpt4 book ai didi

JQuery UI - 无法更改模态对话框中日期选择器中的月份/年份

转载 作者:行者123 更新时间:2023-12-01 03:42:57 25 4
gpt4 key购买 nike

模态对话框中使用日期选择器,请不要在 Firefox 19.0.2 中使用更改月/年下拉列表,请参阅:

http://jsfiddle.net/469zV/2/

HTML

<div id="dialog-form" title="test" style="display:none">
<form>
<fieldset>
<p>Date1: <input type="text" id="datepicker"/></p>
</fieldset>
</form>
</div>

脚本

$( "#dialog-form" ).dialog({
modal: true
});

$("#datepicker").datepicker({
changeMonth: true,
changeYear: true
});

经过大量搜索,可以找到有关此问题的一些信息,但没有找到解决方案:

http://bugs.jqueryui.com/ticket/8989#no1

如何解决这个问题?

最佳答案

选择日期后,您需要模糊文本框,以便它可以重新触发焦点事件:

$( "#dialog-form" ).dialog({
modal: true
});

$("#datepicker").datepicker({
changeMonth: true,
changeYear: true
}).on('change',function(){
$(this).blur()
});

关于JQuery UI - 无法更改模态对话框中日期选择器中的月份/年份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16797893/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com