Title: Language validation message
Last modified: July 20, 2020

---

# Language validation message

 *  Resolved [Ericmuc](https://wordpress.org/support/users/ericmuc/)
 * (@ericmuc)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/language-validation-message/)
 * I have a question regarding the language of validation messages.
 * I have a acf form in the woocommerce cart with some custom code in functions.
   php. I have let added a PDF download and PDF E-Mail. The download creates a PDF
   with data from the acf form, all without validation, because it shall be possible
   to create a PDF only with the products and without any acf fields.
 * But with the PDF E-Mail the user must add his e-mail address and this is coded
   in functions.php ike this:
 *     ```
       add_action('wp_footer','custom_javascript');
       function custom_javascript(){?>
       <script type="text/javascript">
           jQuery(document).ready(function(){
               jQuery(".wc-proceed-to-checkout .cart-pdf-button").click(function(e){
                   var $this = jQuery('.acf-form');
                   var pdfaction = jQuery(this).data('action');
                   if(pdfaction == 'email' && jQuery('.acf-field-email input').val()==''){
                       jQuery('.acf-field-email input').attr('required','required');
                       e.preventDefault();
                   }else{
                       jQuery('.acf-field-email input').removeAttr('required');
                   }
                   pdfaction = pdfaction.trim();
                   if ($this.find('#pdfaction').length) {
                     $this.find('#pdfaction').val(pdfaction);
                   } else {
                     $this.append('<input type="hidden" id="pdfaction" name="pdfaction" value="'+pdfaction+'" />');
                   }
   
                   //jQuery('.acf-form').append('<input type="hidden" name="pdfaction" value="'+jQuery(this).text()+'">');
                   jQuery(".acf-form-submit button").click();
                   e.preventDefault();
               });
           });
       </script>
       <?php }
       ```
   
 * It works. But the validation message is in the browser language (here German),
   not in the language of the wordpress system (English). Please see this image (
   I set name in acf form as required to see the difference):
 * Name = set in acf form as required
    E-Mail = set with functions.php as required
 * Please see image hier: [https://iqbox.cloud/index.php/s/mn23ggd5LR9WNSH](https://iqbox.cloud/index.php/s/mn23ggd5LR9WNSH)
 * So my question: what can I do to get the validation message set by requirement
   by functions.php also in English language?
 * Thank you und best regards

Viewing 1 replies (of 1 total)

 *  Plugin Author [fabianlindfors](https://wordpress.org/support/users/fabianlindfors/)
 * (@fabianlindfors)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/language-validation-message/#post-13152583)
 * Hi, Eric!
 * As you have noticed, when using the “required” attribute, ACF will automatically
   use the error provided by the browser instead of an error generated server-side.
 * This feature is implemented in ACF so unfortunately, I can’t offer much help.
   I would recommend reaching out to ACF support and see if they have some nifty
   filter or similar for changing the error message through Javascript.
 * All the best!

Viewing 1 replies (of 1 total)

The topic ‘Language validation message’ is closed to new replies.

 * ![](https://ps.w.org/advanced-forms/assets/icon-256x256.png?rev=1894254)
 * [Advanced Forms for ACF](https://wordpress.org/plugins/advanced-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-forms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [fabianlindfors](https://wordpress.org/support/users/fabianlindfors/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/language-validation-message/#post-13152583)
 * Status: resolved