将 jQuery UI 日期选择器分成 3 个单独的文本框
有谁知道将 jquery-ui datepicker 的输入分成 3 个单独的框的优雅方法?
默认情况下,它的输入只是一个文本框:DD/MM/YYYY
我必须将输入分成 3 个单独的日期、月份和年份:DD
, MM
和 YYYY
。
Does anyone know of an elegant way of separating the jquery-ui datepicker's input into 3 separate boxes?
By default its input is just one textbox: DD/MM/YYYY
I have to separate the input into 3 separate ones for day, month, and year: DD
, MM
, and YYYY
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
工作示例 http://jsfiddle.net/jomanlk/7NgpQ/
working example http://jsfiddle.net/jomanlk/7NgpQ/
您可以使用
datepicker
函数onClose
然后获取该值。请参阅此 http://jsfiddle.net/96FPU/
这仅在
dateFormat 被数组索引正确引用,即在我的示例中,它从日 = 索引 0、月 = 索引 1、年 = 索引 1 开始工作。另外,在我的示例中,我只是将值分配给
spans'
You can use the
datepicker
functiononClose
then grab the value.See this http://jsfiddle.net/96FPU/
This will only work if the
dateFormat
is correctly referenced by the array index, i.e. in my example, it is working from day = index 0, month = index 1, year = index 1. Also in my example i am just assigning the values tospans'
您可以使用
.datepicker('dialog')
方法来达到这个效果。查看实际操作:http://jsfiddle.net/william/QHasQ/。
You can use the
.datepicker('dialog')
method to achieve this effect.See this in action: http://jsfiddle.net/william/QHasQ/.