Blind Form Submissions for Website | Community
Skip to main content
October 12, 2015
Question

Blind Form Submissions for Website

  • October 12, 2015
  • 4 replies
  • 4164 views

Hi there,

I was wondering if anyone have any suggestions on implementing blind form submissions for a few of our web pages.

The main idea is:

Buttons gets clicked > Form submits if cookie is recognized / form shows if it's an unrecognized cookie > Directs to the content page

Thank you!

Best,

Gina

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

4 replies

Adobe Employee
October 12, 2015

Hi Gina,

I think this is what you're looking for.

Show Custom HTML Form for Known Leads - Marketo Docs - Product Docs

Basically, if the lead is known (recognized cookie) then they'll be able to click right through.  If not, then they'll be presented with a form.

John

October 12, 2015

Thanks, John.

I was aware of that form capability, but it didn't redirect me to the next page when the user was recognized and the form was hidden.

Perhaps there is a script I need to add to automatically submit when the form is hidden? This is the part where I got stuck.

Grégoire_Miche2
Level 10
October 12, 2015

Indeed, the "Know user" feature does not bring you to the next page. It enables you to get the content or a link to the next page.

To do it exactly the way you want, you will need some scripting using the forms 2.0 API : Forms 2.0 » Marketo Developers

-Greg

Adobe Employee
October 12, 2015

Ahh, I see.

The form will always show, as there's no way to automatically submit it.  The lead will have to click the button even if they're a known lead, but it makes it so they don't have to fill in all of their information again.

John

October 13, 2015

Thanks everyone for the input. I'll discuss with my supervisor and see what is the best way to implement this.

October 20, 2015

We were able to get what we want by adding a JS block on the iframe/landing page. If fields are not empty (our fields are set to autofill), then it will redirect to the follow-up page; else, the form will load.

SanfordWhiteman
Level 10
October 21, 2015

I assume this is a Marketo-hosted LP.  Otherwise, from your brief description, you probably have a race condition causing the code to only work some of the time. 

October 21, 2015

Yes, it's a Marketo-hosted LP with the script attached to it.

Below's the sample script we used:

<html>

  <head>

  <script type = "text/javascript">

  MktoForms2.whenReady(function (form) {

  // Put your code that uses the form object here

  var email = document.getElementById('Email').value;

  var first_name = document.getElementById('FirstName').value;

  var last_name = document.getElementById('LastName').value;

  var company = document.getElementById('Company').value;

  var image = document.getElementById('loading_gif');

  var form = MktoForms2.getForm(####);

  form.onSuccess(function (values, followUpUrl)

  { window.top.location.href = followUpUrl; return false;

  });

  if (email != "" && first_name != "" && last_name != "" && company != "")

  {

  form.getFormElem().hide();

  document.getElementById('loading_gif').style.display = "block";

  form.submit();

  }

  else

  {

  }

  });

  </script>

  </head>

  <body>

  <img id='loading_gif' src="image_url" style="display: none;">

  </body>

</html>