Cognito Forms logo
Experience the future of Form Building Start Building Now!

Using Custom Error Messages on Your Forms!

Posted by Nadia A. 01/18/2016 Categories: Calculations Tips & Tricks

The custom error field can prevent users from selecting specific days of the week.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.

The custom error field allows users to create their own validation rules for their form fields.

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:

The conditional logic builder will show an error on certain days of the week.

Make sure to save your changes. Now, in the second blank box, you can write your custom message:

You can write a custom error message to display underneath your form fields.

Finally, if your customers tries to select Saturday or Sunday in the Date field, they'll see your custom error message:

The user can only select days between Monday through Friday.

Validating fields

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:

The advanced editor allows users to write calculations to ensure that two form fields match.

Next, write your custom message in the second box:

A custom error message that informs users that their emails do not match.

Now, when a user types in an email that doesn't match the original Email field, a message will appear to let them know.

A custom error message that informs users that their emails do not match.

Have any questions about custom errors or how to create them? Feel free to contact us and let us know!

Gravatar Nadia is the Marketing Coordinator for Cognito Forms. In her spare time, Nadia enjoys spending far too much time on YouTube, eating Swedish Fish, and cuddling with her two Chihuahuas.
Printable View