Possible to Block Form Submissions? | Community
Skip to main content
Alexis_D_Alba1
New Participant
May 3, 2016
Solved

Possible to Block Form Submissions?

  • May 3, 2016
  • 3 replies
  • 6868 views

Hi there,

We have a unique situation ----when a lead selects a specific option on one of our forms,

the submit button will drive to a dedicated landing page. We do not want this to count as a form submission because these leads are not opting into anything and adding them as new leads would not be valuable.  Is it possible to prevent this click from counting as a "fills out form" activity?

Best answer by SanfordWhiteman

Demo/code: MktoForms2 :: Conditionally Bypass Submit

In the example, if you enter "Alexis" as your First Name, then form submission to Marketo is bypassed and you go straight to another URL.

(Note I use onSubmit as opposed to onValidate because it plays better with 3rd-party validation plugins. Lately I have seen some bad problems at clients with competing copy-and-pasted form event listeners, by the way, each one erroneously expecting that it's the only plugin. I have to write some guidelines about this issue when I have a chance.)

3 replies

Alexis_D_Alba1
New Participant
May 4, 2016

This is great! thank you for your help.

May 3, 2016

You can write javascript using Forms 2.0 to simply 'redirect' to the desired landing page if those 'specific' values are selected. Rest all submissions should go fine as usual. You can use form.onValidate call.

Rajesh

SanfordWhiteman
New Participant
May 3, 2016

Sure, very simple.  Just to be clear: the same form is also used for other form submissions that you do want to count, right?  So the "non-submit submit" only applies when certain values are selected.

Alexis_D_Alba1
New Participant
May 3, 2016

Thank you! and @Sanford Whiteman​ that's correct.  We do want the form submission to count if option A and B are selected. But if option C is selected we do not want the submission to count.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 4, 2016

Demo/code: MktoForms2 :: Conditionally Bypass Submit

In the example, if you enter "Alexis" as your First Name, then form submission to Marketo is bypassed and you go straight to another URL.

(Note I use onSubmit as opposed to onValidate because it plays better with 3rd-party validation plugins. Lately I have seen some bad problems at clients with competing copy-and-pasted form event listeners, by the way, each one erroneously expecting that it's the only plugin. I have to write some guidelines about this issue when I have a chance.)