How can I ensure that two fields have the same value?

In Cognito Forms, you can use the Custom Error option to display custom error messages. For example, you can display an error message when two Email fields do not contain matching addresses:

  1. Add an Email field labeled “Email” and another Email field labeled “Confirm Email”.

  2. Select the Confirm Email field and find the Show Custom Error - When option in the field settings.

  3. Set an error to display when the two Email field values do not match:

  4. Click Save to close the conditional logic dialog.

  5. Enter the error message you wish to show when this error occurs (ex: “Email addresses don’t match.”)

Now, when a user tries to enter a different value into the second email field, they’ll see your custom error message.

Validate that two email fields have the same address.

Learn more about custom format validation in our Advanced Validation tutorial.