Date Picker and Validation in the Text Field | XM Community
Skip to main content
To whom it may concern,

I was able to apply the "date picker" to a text field.

However, I noticed quickly that I seem to have problems with validation on the text field using date picker at the same time.



Want to know if it is possible to either:

1. Prevent user entry into the text field - forcing the use of the "Date Picker"

2. Add validation for the text field, should the user type into the field, the date format of the "date picker" selection is extended to that field so I don't end up with gobblygook.

See image: !



Thank you.
Hello @JSwiez ,



Paste the below code to js(Onready) of the text entry question:



jQuery("#"+this.questionId+" .InputText").attr("readonly",true);



This will prevent user to type something in text box.
Thank you! That helped!

Have a great day.

Leave a Reply