Re: Marketo Snippet Question

Anonymous
Not applicable

Marketo Snippet Question

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

 
Tags (1)
3 REPLIES 3
Josh_Hill13
Level 10 - Champion Alumni

Re: Marketo Snippet Question

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.
Anonymous
Not applicable

Re: Marketo Snippet Question

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
 
Alok_Ramsisaria
Level 10

Re: Marketo Snippet Question

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.