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

查看:736
本文介绍了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中输入日期,我查了。 datepicker将默认防止的一件事是,它只允许键入当前日期格式有效的字符。所以如果你的日期格式是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天全站免登陆