How to automatically close contact form on successful sending

3 replies · opened Oct 29, 2019

OosbaldwickOct 29, 2019

I have a form at http://www.osbaldwickandmurtonchurches.org.uk/new/index.html

When the form has successfully sent the data it remains open (blank) which is pointless. How can it be made to automatically close once the message has been successfully delivered?

Also please don't mark this support request resolved until I confirm that it has been!

SSemicolon WebSTAFFOct 31, 2019

Hello,

Simply using the following JS Code at the bottom of the Page should fix this:

jQuery('#template-contactform').on( 'formSubmitSuccess', function(){
	jQuery('#contactFormModal').modal('hide');
});

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

OosbaldwickOct 31, 2019

Which page are we talking about. If I add it to the page that contains the form it makes no difference and if I add it to form.php, the form just hangs after submission. Please clarify what you mean.

SSemicolon WebSTAFFOct 31, 2019

Hello,

The JS Codes cannot be added to PHP Files. You will have to add this to the HTML Page which contains the Form.

Please provide us with a Live URL so that we can check out the exact issue and provide you with more assistance on this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard