A couple months ago, we released our custom validation rules feature - but what exactly are custom validation rules? Simply put, you have the ability to create your own error messages underneath your form fields and set the conditions under which those messages will display.
Creating custom errors
Say, for example, that your business doesn’t operate during the weekend; with the custom error option, you can set an error message to display underneath your Date field if your customers try to select a Saturday or a Sunday.
To begin, click on the field that you want to contain a custom error. Then, find the “Show Custom Error” option at the bottom of the field settings and select When.
Next, the conditional logic builder will appear. Here, you can specify what conditions on the form will cause an error message to appear. In the example with our business only operating during the week, we want an error message to display when the day of the week is Saturday or Sunday:
Make sure to save your changes. Now, in the second blank box, you can write your custom message:
Finally, if your customers tries to select Saturday or Sunday in the Date field, they’ll see your custom error message:
There are many different scenarios in which you can take advantage of this unique feature, such as confirming that two email fields match.
In addition to setting conditions with basic conditional logic, you can also use the Advanced Editor to write calculations. In this case, we want an error message to appear when our second email field is not the same, or equal to (=) the first email field:
Next, write your custom message in the second box:
Now, when a user types in an email that doesn’t match the original Email field, a message will appear to let them know.
Have any questions about custom errors or how to create them? Feel free to contact us and let us know!
Nadia is the Marketing Coordinator for Cognito Forms. In her spare time, Nadia enjoys listening to French house, drinking iced coffee, and talking about herself in third person.