form is hang on submit button after hit submit

Exactly same error here. Site is already on SSL, no error message whatsoever. Contact is added, but redirect is not working.

Thanks to @andrass I could solve the problem by making a small change to media/js/mautic-form.js.

Here are the details:
https://github.com/mautic/mautic/pull/4656

I dont see that code in the JS file… @MichaelvanLaar

I found and replaced that code within the js/mautic-form-src.js file and the forms are still not redirecting or dispalying success message… Any other advice?

@jwldub Update in both /mautic-form-src.js and /mautic-form.js, the code if (event.origin !== MauticDomain) return; is in both of them. Search for “event.origin” if you can’t find that line, that’ll help find it.

Then replace if (event.origin !== MauticDomain) return;

with

var MauticDomainWithoutPath = MauticDomain.match(/https?://[^/]*/); if (event.origin != MauticDomainWithoutPath) return;

in both files. Details are see in this PR like @MichaelvanLaar said: https://github.com/mautic/mautic/pull/4656

Thanks @MichaelvanLaar !! Been looking for a fix FOREVER… glad these dev forums are working out!

PS: You need SSL for your mautic domain, or at least I did (https://www.mautic.org/community/index.php/2802-mautic-http-to-https/0), and you can’t be logged in to your mautic account in the same browser as trying to submit the form, or it’ll hang. After applying the code change in both /mautic-form-src.js and /mautic-form.js and having SSL, it’ll submit in incognito window every time. :slight_smile:

I am SOOOOOOO GLAD I found this post.

This works. After days of frustration I followed these steps and now the SUBMIT button action is working again.

NOte the submit button did actually submit the data etc, its just the ACTION of displaying a message or redirecting was not working.

ALSO NOTE: My mautic is NOT using SSL (yet) and this fix worked.

For newbies, what this means is you are actually editing two files in your mautic installation.

The location of those files is in the following directory [yourwebsite/mautic installation directory]/media/js/

In the “media/js” directory is where you will find the two files named above.

mautic-form-src.js and mautic-form.js

I recommend making a copy of these original files before making any changes.
Then open the files named above and replace the lines as described above.

You should also then clear your app cache,.

You should be good to go again.

Thanks everyone.

@ffmarketing Thank you very much for your trick! Works fine for me. I replaced this line of code and… BOALÁ! Forms goes again in WordPress (but no campaigns or dinamyc content. xD I can not understand why the people to own Mautic not define clearly what a stable version means)
(I am using now Mautic is 2.10.0 because 2.9.2 one day without any change died. Unbelievable.
So, thanks again

Just want to add a note to keep this item current because it’s important.

When I first read this thread, it was indicated that keeping the version current was the issue but it’s really not. this button hang was an intermittent problem for us in 2.9, was still an issue in 2.9.1and 2.9.2 and amazingly was still an issue in 2.10…

The fix in this thread suggested by @ffmarketing has just been implemented by our dev team and it works. So massive thank you for posting it.

Not sure what needs to happen for this fix to be applied to the source so no one else experiences this issue but whatever is needed should be done.

I got please wait problem since 2.9.0 but I found out the temporary solution for making form works.

Just simply create a blank landing page then manually insert form code --> save. Use the landing page url then the form is working again.

The very latest version Mautic, a brand new instance, a blank new database and this problem existed - so a problem out of the box. Fortunately, the edit to the 2 files mentioned above sorted out the problem.

Seeing as this problem has existed since 2.9 and there seems to be a solution, why has it not been fixed in 2.10.1?

Thanks for the solution @MichaelvanLaar and @ffmarketing

I know escopecz is trying to help… moreover he is amazing for the time and effort he puts forth helping others. Thank you, Sir! Having said that, the Submit Button issue is old. Obviously, if it were fixed at any time over the past few revisions, escopecz would not have to repeat the same thing fifty times over. I’m quite flustered this afternoon and continue to work on the issue. But I’m not a coder and at some point will be forced to uninstall and move my site back to my regular host. I currently have some of my clients on Sendy but I truly want to learn Mautic and use it to help these customers. Next, @MichaelvanLaar and @ffmarketing 's solution… maybe that will work.

For those who may have made the same mistakes as me and are seeing the same or similar errors in their console of the developer tool. Make sure that the reference in Mautic settings and any CMS(I am using wordpress with the Mautic plugin) that you are using are completely uniform. i.e. if you are using https://site.com/mautic/directory , make sure that you do not have the www (https://www.site.com/mautic/directory) in any location from the site URL down to the CORS.

Unfortunately, I have not fixed the open submission issue even though I do not have any errors.

https://user-images.githubusercontent.com/28539311/30786258-0adf19ea-a141-11e7-9780-7efb43103a10.png

https://user-images.githubusercontent.com/28539311/30786270-45682f70-a141-11e7-8ae2-495423615f6e.png

has anyone had any updates on this particular issue? I am wondering what @escopecz and/or @ffmarketing may think is the issue as well.

@ffmarketing 's solution worked for me and @raymondkent helped me find the correct files.

Thanks to @sergio.bolinches for bringing me to this thread.

I’m also not using SSL but the fix worked for me!

The fix from @ffmarketing and @MichaelvanLaar is a live saver! I’ve been looking for the solutions for this problem for almost a week !

This fix worked fine. Thank you guys.
PS: why the heck isn’t it on the software repo as a standard?

Thank you! THank you!!