Question T3541
Visible to All Users

Six digits for years in text boxes

created 5 years ago

Hello again!

We've found another issue when setting up a single input question and setting it to accept a date. The watermark implies a user should input mm/dd/yyyy, but an overexcited user can input mm/dd/yyyyyy giving six digits for the year. Our QA team wants us to fix it, but it doesn't look like it's something we can fix on our own. Can someone set up some validation to enforce four digit years?

The reproduction steps are below along with attached screenshots showing the results.

Reproduce steps:

  1. Add a new single input question type and se the input type to "date."
  2. Fill out the survey with the date question, entering six digits for the date.
  3. The survey results show the incorrect six digit year.

Thank you again,
Chris

Answers approved by surveyjs Support

created 5 years ago

Hello,

You can try to use the inputmask custom widget, as shown in this live sample on our site - https://www.surveyjs.io/Examples/Library?id=custom-widget-inputmask&platform=jQuery&theme=modern

Thanks, Serge
SurveyJS Team