Format validations are used to enforce participants enter a response following a specific format requirement, for example you may want them to enter a valid email address, date, or time of day. There are nine predefined format types available. Custom formats can also be specified.
SEE ALSO – Configure Question Validation for details about other validations that are available. |
To configure a text format validation:
- Click on a Text Question to open the configuration window.
- Select the VALIDATIONS tab and click on [+ADD VALIDATION].
- Select the Text Format from the Validation Type drop-down list.
- Select a Text Format Type from the drop-down list.
There are nine predefined format ty available:- Email – Answers must include an email in a correct format. The entered email address must include an “@” symbol and a valid domain format, for example, “support@redjade.net”.
- Date (mm/dd/yyyy) – Participants must enter a valid date in mm/dd/yyyy format. A date picker calendar widget displays to select the date from if the questionnaire language is English. The date picker calendar widget is not currently available for other languages.
- Date (dd/mm/yyyy) – Participants must enter a valid date in dd/mm/yyyy format. A date picker calendar widget displays to select the date from if the questionnaire language is English. The date picker calendar widget is not currently available for other languages.
- Currency (US) – Answers must be numeric, can include a decimal point with up to 2 decimal places and optionally include the $ symbol.
- Phone Number (US) – Participants must enter a valid phone number for the US without a country code.
- Phone Number (International) – Participants must enter a valid phone number with or without a country code.
- Zip Code (US) – Answers must be a valid US postal code, either in the 5-digit or 9-digit format.
- Time 24-hour – Participants must enter a valid time of day in 24-hour hh:mm format. A time picker widget displays to select the time from.
- Time 12-hour – Participants must enter a valid time of day in 12-hour hh:mm am/pm format. A time picker widget displays to select the time from.
- URL – Answers must include a web address in a correct format.
- Optionally, edit the INVALID MESSAGE label, as desired.
The invalid message displays when the participant does not enter a response in a correct/valid format. In the example below, Email is the required format: - Alternatively, you can choose the Custom format type to input your own regular expression (regex) pattern depending on your specific requirements. Regex can be quite flexible and powerful, allowing you to define custom validation rules based on the desired text format.
SEE ALSO – Wikipedia: Regular Expression, Regular Expression Language - Quick Reference, and How to write Regular Expressions for additional information on regex. You can also use an AI chatbot, such as ChatGPT, for custom regex patterns to use.