This tutorial describes how to use range and regular expression validation in Nintex Mobile, using a lead generation scenario for validating entries of email addresses and follow-up dates. In this scenario, email addresses are validated for inclusion of the "@" symbol and a period; follow-up dates are validated for occurring within three months of the trade show at which the forms are filled out. The trade show is occurring in August 2016.
To achieve this scenario:
- Create a SharePoint list called "Leads" and add the following columns: Name, Region, Email, Phone, Followup date.
- In Nintex Forms designer, double-click the Single Line Textbox control for Email.
- In the form control configuration dialog box, expand the Validation section and then select Yes for Use a regular expression.
- In the Regular expression field, copy and paste the following expression.
.+@.+..+ - In the Regular expression error message field, copy and paste the following text or enter a similar message.
Invalid format for email address. Please reenter.
Example screenshot of validation configuration: - Click Save to save changes and close the configuration dialog box.
- In Nintex Forms designer, double-click the Date/Time control for Followup date.
- In the form control configuration dialog box, expand the Validation section and then select Yes for Use range validation.
- In the Minimum value field, insert the reference "Current Date."
- In the Maximum value field, specify a date occurring several months after the trade show.
Example: 2017/01/01 - In the Range validation error message field, copy and paste the following text or enter a similar message.
Please enter a date in the future.
Example screenshot of validation configuration: - Click Save to save changes and close the configuration dialog box.
- Add the Nintex Mobile layouts and then publish the form.
Now the form displays errors if users attempt to submit with an email address or followup date not passing validation.