Preventing page reload on form submit and triggering an event onSuccess

Anonymous
Not applicable

Preventing page reload on form submit and triggering an event onSuccess

Hey,

Basically I have a problem whereby I am embedding a marketo form onto a page on my website, and once a user has filled out the form and clicked submit I then provide them with an unlocked product video which is launched in a lightbox. This is working for me, however the page is reloading when you click on the submit button on the form and I obviously dont want it too, I want the video to play and the page to stay as it is.

I am launching the video in the lightbox from the "form.onSuccess" method. Returning false and trying preventDefault() doesnt work as this prevents the whole calling of the lightbox.

I have set the follow up page in Marketo to be "stay on page", but i cant stop the page from reloading when I launch the video lightbox.

Any help with this would be much appreciated.

Cheers

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Preventing page reload on form submit and triggering an event onSuccess

When you return false; from the Marketo onSuccess, you are specifically preventing automatic redirection to the Thank You URL in the Marketo form config.  You aren't affecting any other events and/or default actions.  Can you post a link to your page, please? (Also remember to post these question in the Products and Support section.)