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:
To add this script,
- Navigate to your page in the Classic Builder.
- Give your script a name, set the Placement to Before Body End Tag, and paste in the following code:
- To customize your form validation error messages, update the text within the quotation marks ' ' to whatever you'd like your new message to read. For example:
window.ub.form.validationMessages.your_name.required = 'You forgot to enter your name!';
Here's the result:
Save and Publish your page to finalize these changes!