SOLVED

Re: Form Script on WP Site

Go to solution
Anonymous
Not applicable

Form Script on WP Site

Our website is experiencing issues with one of the forms we created some custom Javascript around. Sanford Whiteman​ I'm told by Geoff Krajesk you may be able to assist? The URL is: Engagio Partnership, Learnings and a Relief – Marvel Marketers Blog . The form at the bottom is the one we are having issues with! It is apparently submitting (I got the autoresponder), but the header isn't refreshing to the TY text we created.

Thank you!
~Jaime

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Script on WP Site

OK, good to hear.

In future, when you have multiple forms (or really always) I wouldn't use the form-specific `ready` event. Instead, use a single `whenReady` listener. Inside that listener, you can always tell what form you're in (form.getId()) and do either all-forms or form-specific stuff.

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Script on WP Site

I see a couple of onReady listeners adding some lightweight onSuccess listeners. I'd strongly recommend doing this in in a single whenReady because otherwise you have identical code in two places, which can become a maintenance nightmare.

That said, the code itself isn't producing any errors (in either place). Can you be specific about the differences between the expected behavior and the current behavior?

Anonymous
Not applicable

Re: Form Script on WP Site

Is this only work for Marketo landing page? We have a Magento page and I add the script via Google Tag Manager, it's not working. The Tag Manager shows the code is broken.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Script on WP Site

"Broken" is too vague for troubleshooting, Vincent. Please post a link to a testable URL and/or an explicit error message.

Also, you should open a new thread for this new question -- only one answer can ever be marked correct, and only by the OP.

Anonymous
Not applicable

Re: Form Script on WP Site

Good news! We figured it out.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Script on WP Site

OK, good to hear.

In future, when you have multiple forms (or really always) I wouldn't use the form-specific `ready` event. Instead, use a single `whenReady` listener. Inside that listener, you can always tell what form you're in (form.getId()) and do either all-forms or form-specific stuff.