How would I use the jqueryUI “datepicker” if I want my input field to allow non-dates (or invalid dates)?
I have a server-side script which can handle a normal date as input, or an asterisk to mean “latest date available” (amongst a few other special codes).
It would be nice to have a popup datepicker in my HTML form, but only when needed.
How can I use the jqueryUI datepicker to choose a specific date (for example, by clicking on a datepicker icon), while also allowing the user to enter one of our special codes as a “fake date”?
Thanks!
You can use the
constrainInputoption to allow all characters to be entered into theinput:See this working example. The first
inputwill allow any characters to be typed. The secondinputwill only allow the defaults allowed by thedatepickerwidget (which I think is just numbers and the/character).