2

I have a textbox that I've attached the datepicker to. If the user enters the date via the datepicker all is well but they also have the ability to go in and enter a bad date directly into the textbox. i.e. 1/55/1995 Can the text box be disabled so only the calendar can be used?

How are people preventing this?

2 Answers 2

1

Looks like what you need is to just disable the field or make it readonly. Check out this answer How can I disable all keyboard keys?

I would say readonly is the better option because it still allows the value to be retrieved when it is posted back; don't think disabled fields get picked up.

Sign up to request clarification or add additional context in comments.

Comments

1

You can validate the input text, if entered manually to the textbox.

Have a look at the url below, http://keith-wood.name/uiDatepickerValidation.html

Hope this helps.

Cheers

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.