Hi there,
If you go to this link https://itassolutions.co.uk/test-comm-form/ the ‘download guide’ button is a content area modal popup that opens a form. Is it possible to make it so the modal closes once somebody has submitted the form?
Thank you
Hi there,
If you go to this link https://itassolutions.co.uk/test-comm-form/ the ‘download guide’ button is a content area modal popup that opens a form. Is it possible to make it so the modal closes once somebody has submitted the form?
Thank you
Hello @hannahlincoln,
Thanks for asking.
You can take a look at following resource to close popup after submitting the form.
Thanks.
Hi,
Thank you for the resources.
I have tried the answers you provided but I am not using convertplug so the solutions have not worked for my issue.
Do you have any other advice?
Thank you for your time
Hi There,
This option is working fine on my end:
Could you pleaase provide us with your admin account so we can take a closer look?
Thank you.
Hi.
I am not using convertplug I am using the content modal element in pro.
I provided the admin account in a secure note in my first post
Hello There,
Thanks for updating in! Please be understand that the Content Area Modal must be triggered by a button for example before it displays any contents in a modal window. You must also understand that you need to click somewhere or in the X
icon (close button) to close the modal window. Now back to your question: Is it possible to make it so the modal closes once somebody has submitted the form?
It might be possible but would need a custom script to handle the event. you must understand the the form handling must be well taken care of and not just to automatically close the modal when the button is clicked. You will need to have the form validation first before the modal window is closed. Within your form validation script, once the validation is successfully, you may need to add this line:
jQuery('.x-modal-close').trigger('click');
Or for example:
function gm_callback_34(){
_gmf.populateFormFields("gm_form_34");
_gmf.loadConfirmStatement("gm_form_34");
jQuery('.x-modal-close').trigger('click');
}
Since your JS code is a 3rd party script, the line may or may not work depending on your code. If it does have any errors, it may work and if it does, the modal window might not close.
Thank you for your understanding.
Thank you so much for your help.
I actually added it here:
function submitCallback_gm_form_34(data) {
if (data.status === 200) {
alert(“Thank you! You should receive an email shortly. Please remember to check your Junk/Spam folder!”);
_gmf.trackSubmissionGatorLeads(“gm_form_34”);
_gmf.clearForm(“gm_form_34”);
jQuery(’.x-modal-close’).trigger(‘click’);
} else if (data.status === 209 || data.status === 403) {
alert(data.statusText);
} else {
alert(“There was an error submitting the form please try again”);
}
};
It seems to work! So thank you