Bob Bob - 11 months ago 180
Javascript Question

JQuery DatePicker ReadOnly

When I make my datepicker read-only, I see that the user cannot type anything into the text box.

$("#datepicker").attr('readonly', 'readonly');

However, they can still change the value using the calendar. How can I hide the calendar so that users cannot change the date value?

I do not want to disable the datepicker since I need the value posted to the server upon form submit.



You can set the range allowed to some invalid range so the user can't select any date: