Mautic Community Forums

Form not working

I made a form within mautic and embedded it in my Wordpress website via the plugin. When loading the page, I can see the following error in the browser console:

Code:
XMLHttpRequest cannot load http://my.mautic.domain/index.php/mtc. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://my.website.domain' is therefore not allowed access.

After filling out the form, the following errors appear in the browser console:
Code:
POST http://my.mautic.domain/index.php/form/submit?formId=1 500 (Internal Server Error) Uncaught SecurityError: Blocked a frame with origin "http://my.mautic.domain" from accessing a frame with origin "http://my.website.domain". Protocols, domains, and ports must match.

How can I bypass these errors? Needless to say that the form does not work, the button label says "Please wait..." and nothing happens.

I am using a self hosted version (2.2.1) and had no problems so far with simple email campaigns.

I made a form within mautic and embedded it in my Wordpress website via the plugin. When loading the page, I can see the following error in the browser console:

XMLHttpRequest cannot load http://my.mautic.domain/index.php/mtc. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://my.website.domain' is therefore not allowed access.

After filling out the form, the following errors appear in the browser console:

POST http://my.mautic.domain/index.php/form/submit?formId=1 500 (Internal Server Error)
Uncaught SecurityError: Blocked a frame with origin "http://my.mautic.domain" from accessing a frame with origin "http://my.website.domain".  Protocols, domains, and ports must match.

How can I bypass these errors? Needless to say that the form does not work, the button label says “Please wait…” and nothing happens.

I am using a self hosted version (2.2.1) and had no problems so far with simple email campaigns.

The XMLHttpRequest error can by bypassed for the moment through starting Chrome with “–disable-web-security”. Of course this is no solution but can help for the moment. Unfortunately the second error (Internal Server Error) remains.

Looking into the Mautic log gave me the hint: In my form I was only asking for a phone number. Of course mautic was not able to identify the contact where this phone number should be written to. After adding a second field for the email the form worked fine.

This leads to another question: Is it possible to fill in the email address automatically if the user is already known?