How do I modify error messages?

I'd like to change the wording of an error message or perhaps change it to another language. How do I do that?

Official response from

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">
  $(function() {
    $.ajaxSetup({
      complete: function() {
        $(".form-errors ul li:contains('Email1')").replaceWith('Email address is required.');
      }
    })
  });
</script>

Notice the default error message says "Email1", but is later switched to Email in the images below.

error-msgs.jpg

 

 

Complete and current information on how to use NationBuilder is available in the documentation section.

Share this post

Showing 13 reactions

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.