Forms 2.0 loads without formid and munckinId populated, get an error on submit | Community
Skip to main content
April 25, 2016
Solved

Forms 2.0 loads without formid and munckinId populated, get an error on submit

  • April 25, 2016
  • 3 replies
  • 3333 views

Using forms 2.0 and loading multiple forms on some of the pages.  Sometimes one of the forms loads and it doesn't have formid and munchkinId populated. Has anyone seen this?

It does not happen 100% of the time.  Tried different computers, browsers, incognito windows etc, sometimes the fields are populated, sometimes they are not.

Have a temporary workaround where I just swing back with some javascript to populate these fields but this should not be happening.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Have you looked into this code in is-mkto.min.js​?

var blockedForms = ["mktoForm_1688", "mktoForm_1182"]; 
for (var a = 0, i = blockedForms.length; i > a; a++)           
  $("#" + blockedForms[a] + " input").val("")

This code specifically clears fields, including hidden fields, and does not appear to be using the Marketo Forms 2.0 event model (i.e. it may have a race condition). One of those two forms (1182) is on your page.

3 replies

Grant_Booth
New Participant
April 27, 2016

You can disable prefill on specific fields in the form editor. There's no need to do that with custom code.

SanfordWhiteman
New Participant
April 28, 2016

It's a third-party site though.  The prefill is from another datasource.

SanfordWhiteman
New Participant
April 25, 2016

Please provide a URL where you can -- at least after a human-capable number of tries -- reproduce this. I haven't dealt with this but It's easy to imagine a situation in which it could happen if you're talking about the same form ID on multiple times on the same page.

AFAIK the formid is actually read from the form descriptor, while the munchkinId is taken directly from the argument to loadForm.  Also note the Forms 2.0 library has been at the same rev for 2 weeks.

April 25, 2016

Hi Sanford,

I have a url, but I have my workaround is running on it so you will not be able to see the behavior. https://www.infusionsoft.com/refer

Can't duplicate this in isolated instances, where I put two forms on a page and that's it, no extra scripts or mumbo jumbo, just the 2 forms. 

Note that It could be one of our scripts that is actually removing the values, but nothing we wrote is targeting those fields.

The forms load async so I can't put dom or javascript breakpoints in to see what's really happening.

Was wondering if anyone ran across it to more narrow down the issue, is it multi Marketo 2.0 forms or conflicting scripts on our end?

Thanks

SanfordWhiteman
New Participant
April 25, 2016

I have a url, but I have my workaround is running on it so you will not be able to see the behavior. infusionsoft.com/refer

Can you please put up a repro URL so I can help you?

The forms load async so I can't put dom or javascript breakpoints in to see what's really happening.

Sure y'can. I do it all the time.

Grant_Booth
New Participant
April 25, 2016

Hi Charles,

Are you doing this on Marketo hosted landing pages or non-Marketo pages? Since Marketo forms interact in a special way with Marketo pages, last I knew it wasn't supported to use multiple marketo forms on the same marketo page by using the embed code in an HTML block or hard-coding it into the template. That may have changed, but I know it used to run into problems.


Grant

April 25, 2016

Doing this on our site.  We have a footer form that is on every page. So some form pages end up with 2 forms on the page. 

Not using embed code or hardcoding the forms, but using the 2.0 code, the form that is rendered is drawn directly from Marketo.