jquery datepicker 日期手动输入 [英] jquery datepicker date manual input

查看:29
本文介绍了jquery datepicker 日期手动输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jQuery UI Datepicker 1.8.4"启用日期手动输入?

How to enable date manual input using "jQuery UI Datepicker 1.8.4"?

我可以在 chrome 中手动输入日期,但默认情况下不能在 firefox 中输入.

I can input date manually in chrome but not firefox by default.

推荐答案

你可以在 chrome 和 firefox 中输入日期,我检查过.日期选择器默认阻止的一件事是,它只允许输入在当前日期格式中有效的字符.因此,如果您的日期格式是03/02/1980",那么它将不允许输入任何字母等,只有数字和/.

You can type in a date in both chrome and firefox, I checked. The one thing that the datepicker will prevent by default though, is that it only allows characters which are valid in the current date format to be typed. So if your date format is "03/02/1980" then it will not allow any letters to be typed etc. only numbers and /.

如果这是您要关闭的功能,以允许输入所有字符,请使用以下命令:

If this is what you want to turn off, to allow all characters to be typed, then use this:

$( ".selector" ).datepicker({ constrainInput: false });

constrainInput 设置为 false 将允许输入任何内容.

constrainInput set to false will allow anything to be typed.

这篇关于jquery datepicker 日期手动输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆