Date Picker and Validation in the Text Field | XM Community
Solved

Date Picker and Validation in the Text Field

  • 26 March 2019
  • 2 replies
  • 35 views

Userlevel 1
Badge +3
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.
icon

Best answer by Anonymous 26 March 2019, 16:35

View original

2 replies

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.
Userlevel 1
Badge +3
Thank you! That helped!
Have a great day.

Leave a Reply