SOLVED

Marketo embedded form wont submit

Go to solution
Port_worx
Level 2

Marketo embedded form wont submit

Hi all,

Our marketo embedded form is throwing a

CORS error and will not submit

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo embedded form wont submit

OK, figured it out.

The problem is you have a race condition between your 2 forms, which are loading from different domains. When the cross-domain IFRAME shim (which is designed to avoid the need for CORS) loads from one domain and tries to post to the other domain, you then need a CORS request, which in turn fails because the server is not set up to respond to OPTIONS requests (it should never receive a CORS request).

This set of conditions will occur randomly, based on network connection speed + quality and cache conditions, since the form descriptors load asynchronously.

Load both forms from the same domain and the problem will go away:

MktoForms2.loadForm("//go.portworx.com", ...

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo embedded form wont submit

No possible way to troubleshoot ​anything​ like this without a URL.

Steven_Vanderb3
Marketo Employee

Re: Marketo embedded form wont submit

There appears to be two forms on this page looking at the source code: id 1181 and id 1061.  Do they exist and are approved in your instance?

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo embedded form wont submit

I can't replicate this in FF or Chrome (nor would I expect to).  What browser + OS + version are you testing this in?

Also that that it wouldn't truly be a CORS error, anyway -- preflight OPTIONS is itself triggered by CORS, but the error is not related to cross-origin communication. It's like getting a 404 for a preflight -- that's not a CORS-level rejection, it's just noticed first by CORS.

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo embedded form wont submit

i think i was able to receive your form.

how did you do that?

Just... filled it out. I didn't receive any errors from either of the 2 forms.

What browser/version/OS are you using, specifically?

Port_worx
Level 2

Re: Marketo embedded form wont submit

Hi Sanford,

and this is the error on inspector

pastedImage_0.png

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo embedded form wont submit

OK, figured it out.

The problem is you have a race condition between your 2 forms, which are loading from different domains. When the cross-domain IFRAME shim (which is designed to avoid the need for CORS) loads from one domain and tries to post to the other domain, you then need a CORS request, which in turn fails because the server is not set up to respond to OPTIONS requests (it should never receive a CORS request).

This set of conditions will occur randomly, based on network connection speed + quality and cache conditions, since the form descriptors load asynchronously.

Load both forms from the same domain and the problem will go away:

MktoForms2.loadForm("//go.portworx.com", ...

View solution in original post