Modifying Form Validation Error Messages

Follow

Modifying Form Validation Error Messages

When a visitor fills out the form on your page but their form entry doesn't validate, they'll see some errors, which look like this by default:

before.png

 

You can modify and customize the wording of these errors by adding a snippet of Javascript to your landing page. Here's the script:

To add it to your page, click Javascripts javascriptsbutton.png button in the bottom left of the Page Builder, and then paste the script in. 

To customize your form validation error messages, amend the values after the = sign to whatever you'd like your new message to read. 

Here's the result:

after.png

 

 

 

 

Note:

Using .email or .phone rather than .required will display only when the email field or phone number field doesn't have the correct input. If you would like the validation to be shown even when the field is empty, you'll need to add both the .email/.phone and the .required custom code to your page.
Was this article helpful?
31 out of 68 found this helpful