Wednesday, April 27, 2016

WP - ACF frontend form showing "Are you sure you want to leave this page?" popup

This can happen after you submit your ACF frontend form via AJAX, and want to navigate away from the form page.

Solution:

Disable this popup by setting this flag:     acf.unload.active = false;

EXAMPLE:



<script type="text/javascript">
jQuery(document).ready(function() {

// setup fields
acf.do_action('append', jQuery('#popup-id'));
    acf.unload.active = false; //disables "Are you sure you want to leave this page box?"


//remove update post:
jQuery(".acf-form-submit").remove();

});



</script>


No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...