Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save VictorPietro/11a592339899e1d9d3331363d1aa9431 to your computer and use it in GitHub Desktop.
Save VictorPietro/11a592339899e1d9d3331363d1aa9431 to your computer and use it in GitHub Desktop.
Close a JetPopup after successful JetFormBuilder submit
jQuery(document).ready(function($) {
// Listen for the JetFormBuilder submit success event
$(document).on('jet-form-builder/ajax/on-success', function() {
// Wait for 2 seconds after the form is successfully submitted
setTimeout(function() {
// Simulate a click on the popup close button
$('.jet-popup__close-button').trigger('click');
}, 2000); // Time in milliseconds (2 seconds)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment