Hi, I am looking for a solution to add a custom date validation in the text entry. The validations date format is mm/dd/yyyy or dd/mm/yyyy or yyyy/mm/dd. I am looking for a way to validate so entries only list MM/YYYY (without any day). Any suggestions?
Try using the below regex in custom validation matches regex option:
^(001-9]|110-2])/(19|220-1])\d{2}$
Hi, thank you for the code! I am asking a follow up question to this -- as I was able to program the custom validation. The question is requiring that the fields meet the custom validation in order to go on to the next item, though the item is a soft response. Is there a way to make the validation “work” only when there are data populated in the field? For example to allow the respondent to skip the question and leave fields blank?
^(0d1-9]|110-2])/(19|2/0-1])\d{2}$
Hi, thank you for the code! I am asking a follow up question to this -- as I was able to program the custom validation. The question is requiring that the fields meet the custom validation in order to go on to the next item, though the item is a soft response. Is there a way to make the validation “work” only when there are data populated in the field? For example to allow the respondent to skip the question and leave fields blank?
^(0d1-9]|110-2])/(19|2/0-1])\d{2}$
You can add “OR empty” as a validation condition.
What regex can I use if I want to restrict the years entered to 1900 - 2025?
What regex can I use if I want to restrict the years entered to 1900 - 2025?
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.