The problem ofa form submission hanging at the “Please Wait” has ben around a while now and multiple updates have not fixed the issue. This was fast becoming a deal breaker for me.
For the non techs out there, this is what is going on. As a non techie this is how I figured it out and understood it.
If you have your mautic installation in a sub directory, ie NOT in a sub domain or on a domain, you will have this issue. So solution number 1 is move your mautic to a domain or sub domain.
If you don’t want to do that then you need to edit some code - a simple cut and paste job. After a form submission Mautic tries to double check something that fails because it is looking for something on the domain on which your Mautic is hosted, but because your matic is in a sub folder the check fails and the form hangs. So we need to change the code so Mautic changes how it does this check it wants to do.
Using FTP or your file manager under your cpanel. Browse to public html, then look for the folder your Mautic is in. Then look for the media folder and then look for a file called mautic-form-src.js and another file called mautic-form.js
Open each file so you can edit the code. use control F to search for event.origin
It will be around 623 and line 38 in the other file.
Look for the code if (event.origin !== MauticDomain) return;
Replace it with var MauticDomainWithoutPath = MauticDomain.match(/https?://[^/]*/); if (event.origin != MauticDomainWithoutPath) return;
make sure this added as one line of code.
Do this in both files.
Delete the cache by looking for the cache folder i your main mautic folder and deleting it. Don’t worry it will be recreated when you use mautic.
This should solve the issue. Test in incognito mode in your browser.
You will need to reapply this fix after every Mautic update until it gets fixed by an update.