Support

Account

Home Forums Front-end Issues How to disable js alert in acf_form

Solved

How to disable js alert in acf_form

  • How can I disable the js alert on an acf_form in the frontend.

    The alert occurs when you edit some fields and then decide to navigate away.

    Please see the attachment

  • Figured it out myself:

    
    jQuery(document).ready(function()
    {
    	jQuery(window).off("beforeunload", null);
    });
    
  • had same issue – your solution didn’t work for me, E’s solution did. So I just want you to know about it incase. I’m using ACF5Pro.

    I put this in as last script before /body. Though I suppose it only has to be below the ACF scripts. I’m using acf_form() w/o the form component to load a repeater field, and navigating away after changes to that field were causing that popup to appear. But no now. 🙂

    link for ref: http://support.advancedcustomfields.com/forums/topic/disable-acf_form-navigate-away-warning/#post-27915

    <script>
    (function($) {
      $(document).ready(function() {
        // disable the ACF js navigate away pop up
        acf.unload.active = false;
      });
    })(jQuery);
    </script>
    </body>
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘How to disable js alert in acf_form’ is closed to new replies.