Form "Not You?" functionality | Community
Skip to main content
November 14, 2013
Solved

Form "Not You?" functionality

  • November 14, 2013
  • 20 replies
  • 5623 views
Do any of you use "Not You?" buttons on forms (along side the Submit button)?

If so, how do you do this functionality?
Thanks!
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rafael_Santoni1
This is how we implemented it.

We have a link in all our Marketo pages that asks the visitor to "click here" if the information on the form is not theirs to re-set the information. Once the person clicks on that, a javascript function we created clears the cookie and re-loads the page.

In addition to that, we check for a URL parameter (userID=guest). If any of our pages are called with that URL parameter present, we also clear the Marketo prefill and all the fields prior to rendering the page. We do that with a short JavaScript function. This allows us to link to any of our Marketo lead capture pages forcing not pre-filling the forms even for known leads if we wanted to.

Summary:
  1. Create a function that would clear the values, cookie, etc.
  2. Place link on your template to call the function to clear and reload the page.
Simple, non-intrusive, and easy to deploy and maintain.

If you wanted to apply the same functionality to the reset button on the form, you can use jQuery to "listen" to a click on the button and fire the same function or have it call the same page with the "magic" URL parameter.

Good luck!

Rafael

20 replies

November 15, 2013
Subscribing to this thread. ;-)
Level 10
November 16, 2013
We are currently trying this for one of our clients. We are reading the Munchkin cookie and using the 'Not You' functionality for similar purpose. Hopefully, we will be able to share a detailed approach for this by coming week. :)
Rafael_Santoni1
Rafael_Santoni1Accepted solution
Level 5
November 16, 2013
This is how we implemented it.

We have a link in all our Marketo pages that asks the visitor to "click here" if the information on the form is not theirs to re-set the information. Once the person clicks on that, a javascript function we created clears the cookie and re-loads the page.

In addition to that, we check for a URL parameter (userID=guest). If any of our pages are called with that URL parameter present, we also clear the Marketo prefill and all the fields prior to rendering the page. We do that with a short JavaScript function. This allows us to link to any of our Marketo lead capture pages forcing not pre-filling the forms even for known leads if we wanted to.

Summary:
  1. Create a function that would clear the values, cookie, etc.
  2. Place link on your template to call the function to clear and reload the page.
Simple, non-intrusive, and easy to deploy and maintain.

If you wanted to apply the same functionality to the reset button on the form, you can use jQuery to "listen" to a click on the button and fire the same function or have it call the same page with the "magic" URL parameter.

Good luck!

Rafael

March 4, 2014
Rafael
Would you be willing to share the JQuery code that you use for this functionality?


Thanks!
Adam 
Rafael_Santoni1
Level 5
March 5, 2014
Sure thing. Let me put it together.
Rafael_Santoni1
Level 5
March 5, 2014
This is what I do to make the "Clear" button reset the visitor properly

// Use jQuery via $jQ(...)
var $jQ = jQuery.noConflict();
 
$jQ(document).ready(function(){
 
// If Clear is clicked remove Marketo cookies, prefill, etc.
$jQ( "#mktFrmReset" ).click(function() {
 
$jQ("#_mkt_trk").val('');
        mktoPreFillFields = {};
        $jQ(".lpeRegForm")[0].reset();
        document.cookie = '_mkto_trk=NULL; expires=-1; path=/; domain=.citrix.com';
 
});
 
});

I have not tested this on pages with forms from the Forms 2.0 editor, only on pages with the original forms editor.
March 6, 2014
Thanks much Rafael!
Rafael_Santoni1
Level 5
March 6, 2014
No problem Adam. Any time.

BTW... this is how I do it with the URL parameter (if the URL has userId=guest):

	if(Mkto.getUrlParam("userId") == "guest"){
	        $jQ("#_mkt_trk").val('');
	        mktoPreFillFields = {};
	        $jQ(".lpeRegForm")[0].reset();
	        document.cookie = '_mkto_trk=NULL; expires=-1; path=/; domain=.citrix.com';
	    }



March 10, 2014
Thanks again.  

I was just working on implementing this today and after playing around with a 2.0 form, I was able to get this working there as well.  The form name referenced in the reset should be ".mktoForm" instead of ".lpeRegForm".  

So this:
$jQ(".lpeRegForm")[0].reset();

Should become this:

$jQ(".mktoForm")[0].reset();

And everything should work.  

Thanks!
Adam
Rafael_Santoni1
Level 5
March 10, 2014
Hey Adam, I am curious about one thing. That would not work in my case because my forms never make use of that class. Mine consistently use lpeRegForm instead. Are you using the original form editor or version 2?