Form Script on WP Site | Community
Skip to main content
February 15, 2017
Solved

Form Script on WP Site

  • February 15, 2017
  • 2 replies
  • 2289 views

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

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

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.

2 replies

February 15, 2017

Good news! We figured it out.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
February 15, 2017

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.

SanfordWhiteman
New Participant
February 15, 2017

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?

July 7, 2017

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
New Participant
July 7, 2017

"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.