Using Custom Error Messages on Your Forms!

Nadia A. By Nadia A. | January 18, 2016

Earlier this year, 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 that cause those messages to 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:

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:

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 A.

Nadia A.

Nadia, the Technical Writer for Cognito Forms, develops documentation, support content, and how-to videos. No matter your experience – with her help, you'll be able to take full advantage of the product. In her spare time, Nadia enjoys listening to French house, drinking coffee, and talking about herself in third person.

Cognito Forms allows you to easily build powerful forms. Sign Up Now
Blog