How do I close the popup when a Forminator form is submitted successfully?
If you have a Forminator form in your FireBox campaign and you’d like to close the popup right after your form has been successfully submitted, you should edit your FireBox campaign and go to Advanced > Custom Javascript and add the following Javascript snippet:
FireBox.onReady(function() {
const campaign = FireBox.getInstance({fpf fb.id});
jQuery('#forminator-module-123').on('forminator:form:submit:success', function(e) {
campaign.close();
});
});
- Replace 123 with your Forminator Form ID.
How to make it close after X seconds?
In the above Javascript snippet, replace:
campaign.close();
with:
setTimeout(function() {
campaign.close();
}, 2000);
This will automatically hide the popup 2 seconds after the form has been submitted.
- Replace 2000 with the delay in milliseconds.
Was this helpful?