jquery使日期选择器始终保持打开状态
日期选择器的正常行为是在单击文本框时打开,在选择(单击)日期时关闭。我需要做的是保持它从表单加载中打开并允许用户重复单击。我正在处理单击事件,
谢谢
Normal behavior of datepicker is to open when a texbox is clicked and close when a date is selected(clicked). What I need to do is Keep it open from form load and allow user to click repeatedly.I am handling the click event
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据文档,您可以在 div 而不是输入上调用它,并且它将保持打开状态并内联。 http://jqueryui.com/demos/datepicker/#inline
您可以使用它的 onSelect 事件处理选择日期的情况。
According to the documentation, you can call it on a div instead of an input and it will stay open and be inline. http://jqueryui.com/demos/datepicker/#inline
You could use it's onSelect event to handle when a date is selected.
如果您使用的是 jQuery UI 日期选择器,请使用:
http://jqueryui.com/demos/datepicker/ #inline
然后您可以处理点击事件并将所选日期添加到文本字段。
If you are using the jQuery UI datepicker, use this:
http://jqueryui.com/demos/datepicker/#inline
You can then handle the click event and add the selected date to the text field.
我完全同意@Corbin
我想提供完整的示例,以便详细帮助某人。
如果您想让 jQueryui 日历默认打开并捕获日历的点击事件,请按照以下步骤操作:
HTML 代码:
您的脚本应如下所示:
并且您可以像以下代码一样获取日期的选定值:
I totally agree with @Corbin
I would like to provide full example so that help someone in details.
If you want to to have jQueryui calendar default open also capture the click event of calendar follow bellow steps:
HTML Code:
and your script should look like bellow:
and you can get the selected value of date like bellow code: