Marketo Snippet Question | Community
Skip to main content
December 31, 2014
Question

Marketo Snippet Question

  • December 31, 2014
  • 3 replies
  • 887 views
I have a snippet that has a form. I would like to able to call a js function onsubmit and when I add it the snippet editor just ignores this.
How do I make this work? Please help!
thanks!
Anand

I have the js file that has the validate_form fuction and form_fields defined above the form definition as shown below. I am trying to add the onsubmit piece but it keeps ignoring it..

<div id="my-form"><form action="https://foobar.com/formsubmit" method="post" onsubmit="return validate_form(form_fields)"
....
<!--form--> <!--start_trial-->

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

3 replies

Josh_Hill13
Level 10
December 31, 2014
Is this not working when you use the snippet on a page? Have you tried putting the snippet on the page w/o the form and putting the custom html down on the page directly?

I haven't heard of people using snippets for form insertion before, so I wonder if that has something to do with it.
December 31, 2014
I am using the snippet to go directly to my target web app and bypass marketo altogether.. I am calling back into Marketo with some of the form data from my web app.
When I try to modify the form action to add the onsubmit part (using the snippet HTML editor), the editor ignores is altogether.
Works directly as custom html on the page
 
Level 10
January 5, 2015
Hi Anand,

I would recommend that instead of bypassing the Marketo, make it as default and call your web app using the web hook and trigger, now you can map the web app response with some Marketo fields also.