Support

Account

Home Forums Front-end Issues Disable acf_form() navigate away warning Reply To: Disable acf_form() navigate away warning

  • Hi Jess –

    Not sure I 100% follow – is there an acf_form() on the page. I believe the acf javascript obj gets loaded with the header scripts. <?php acf_form_head(); ?>

    It wouldn’t be hard to just write some jquery/javascript to basically change a var if the user changes a field, and throw a warning like this.

    window.onbeforeunload = function(){
      if (change) {
        return 'Are you sure you want to leave?';
      }
    };

    See: http://stackoverflow.com/questions/7080269/javascript-before-leaving-the-page