Hi @hilltoprunner,
To start with, please do make sure you have set the “After Submission” setting to “Hide Form” with the auto close set to 5 seconds, under Behavior > Submission Behaivor > After Submission:
View post on imgur.com
Once done, you can try this snippet:
<?php
add_action( 'wp_footer', function(){
global $post;
?>
<script type="text/javascript">
jQuery( document ).ready( function($) {
setTimeout(function() {
$('.forminator-custom-form').trigger('after.load.forminator');
},100);
$(document).on('after.load.forminator', function(event, form_id) {
jQuery('form.forminator-custom-form').on('forminator:form:submit:success', function (e, formData) {
var form_id = e.target.id;
if ( form_id == 'forminator-module-233' ) {
setTimeout(function(){
window.location.replace("https://google.com");
}, 2000);
}
});
});
});
</script>
<?php
}, 9999 );
In the above code, you’ll need to update the following line with your form ID, suppose the form ID is 123, then the following code will change from:
if ( form_id == 'forminator-module-233' ) {
To:
if ( form_id == 'forminator-module-123' ) {
You’ll also have to update the following URL in the code to your redirect URL:
window.location.replace("https://google.com");
The given code can be added as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
I can confirm the code works when tested. Please do check and see whether it works fine.
Best Regards,
Nithin