JQuery DatePicker constrain to only valid dates?
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
精彩评论