Having a Field Form Question with Both Forced Response and Specific Date Format | XM Community

Having a Field Form Question with Both Forced Response and Specific Date Format

  • 15 November 2022
  • 3 replies
  • 102 views

Badge

Hello all!
I have this problem where I want to do both things in one question to keep the survey uniform but the only solution I can see is separating the form question into two separate questions. I have 6 fields being filled in: First Name, Middle Name, Last Name, Preferred Name, Age, and DOB (Date of Birth). First Name and Last Name are forced response, Age is required to be a numeric value and DOB is required to be in a mm/dd/yyyy format.
Capture.PNG
The issue is that I want DOB to be forced as well, but I cannot force the full form field question since not all respondents have a middle or preferred name. Besides separating the Age and DOB fields into their own question, has anyone found a way to force a date to be answered AND in a specific format? And if not, which Qualtrics overlord do I pray to to make it a feature in Qualtrics?🙏
Thanks!
Royce Spilker


3 replies

Userlevel 5
Badge +25

Hi genkikun,
You can do custom validation but it requires a little bit of programming. This thread here is actually a really good example you should be able to follow along.
The tricky bit for you will be validating the date format. Dealing with dates and times in programming is generally notorious, and JavaScript has its own set of quirks on top of that. This StackOverflow answer addresses a problem similar to yours, otherwise some Googling should help you find your way.
Good luck!

Userlevel 5
Badge +25

Also, you can request new features here :)
https://community.qualtrics.com/XMcommunity/categories/product-ideas

Userlevel 7
Badge +27

genkikun ,
The other option is to use JS to force a valid date to be entered in the date field using something like flatpickr or cleave.js.

Leave a Reply