I'd like to change the wording of an error message or perhaps change it to another language. How do I do that?
This is something that can be done using Javascript. Using this code example below you can target specific tags in the error message that contains the text you'd like to replace. Below, I'm locating the <div class="form-errors"> and traversing down through the <ul> and <li> tags until I find the one containing the text "Email1" in which case I replace it with my new text.
<!-- CHANGE ERROR MESSAGE -->
<script language="JavaScript">
$(".form-errors ul li:contains('Email')").text('Email address is required.');
</script>
Notice the default error message says "Email1", but is later switched to Email in the images below.
UPDATE: Check out the suggestion by Alex Flint below for a more complete solution.
Showing 14 reactions
Sign in with
Certified Architect
Certified Expert
Certified Developer
Certified Architect
NationBuilder employee
In your case, you’d want to replace “Email1” in the above code with “1 Error Occurred While Processing This Form”, and replace ‘Email address is required’ with whatever text you’d like to display instead. I’d recommend including this script at the bottom of your donation page template to avoid it being applied to errors on other pagetypes. Hope that helps!
Tim Wayne
Certified Architect
Certified Expert