Modifying Form Validation Error Messages


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:


If you like, you can customize these errors in a couple of ways:

Customize the wording

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

To add it to your page, click Javascripts in the bottom left of the Page Builder, and then paste the script in. Then, adjust the bottom script to add your custom messages.


For example, if you have a field with the ID of email_address, you can adjust its error messages with a line like this:

errors.changeField('email_address', 'Please enter an email address', 'This email address is invalid');

Here's the result:



Was this article helpful?
12 out of 23 found this helpful