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

In Cognito Forms, you can use the Custom Error option to show error messages for any reason. For example, you can show an error message when two email address fields do not have the same value. To do this:

  1. Add an Email field called “Email” and second Email field called “Confirm Email”.
  2. For the confirmation field, select Show Custom Error - When, and enter this calculation into the Advanced Editor: =(ConfirmEmail != Email)
  3. Click Save to close the conditional logic dialog.
  4. Enter the error message you wish to show when this error occurs (ex: “Emails do not match.”)

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