开发者

JQuery DatePicker constrain to only valid dates?

开发者 https://www.devze.com 2023-03-25 21:55 出处:网络
I am currently using the JQuery datepicker, however it doesn\'t appear to enforce the input of only valid dates. Is this possible? For example, it will allow me to manually enter 22/22/22 into the dat

I am currently using the JQuery datepicker, however it doesn't appear to enforce the input of only valid dates. Is this possible? For example, it will allow me to manually enter 22/22/22 into the date field. As a last result is it possible to only allow users to enter a date via the picker p开发者_开发技巧opup?

Thanks


Try using the jQuery UI Datepicker Validation plugin. It works with the jQuery Validation plugin and provides the exact functionality you are asking for.


try this ideas

<input type='text' id='date' readonly='true'>

or

$("#date").keypress(function(event) {event.preventDefault();});

or

$("#date").attr( 'readOnly' , 'true' );

more details here jQuery Datepicker with text input that doesn't allow user input

0

精彩评论

暂无评论...
验证码 换一张
取 消