Follow-up page based on checkbox

Anonymous
Not applicable

Follow-up page based on checkbox

I'm trying to create a subscription management page and have several options that people can subscribe to.  If they subscribe to anything, I'll take them to a "thank-you" page.  But if they check the checkbox "Unsubscribe" I want to take them to a different page.

Here's what I'm trying (which isn't working):

function formSubmit(elt) {
  if ($jQ("#Unsubscribed").attr('checked')==true) {
    var ReturnUrl = 'http://www.google.com'
    $jQ("input[name='returnURL']").attr('value', ReturnUrl );
    $jQ("input[name='retURL']"   ).attr('value', ReturnUrl );
    }
  return Mkto.formSubmit(elt);
}

I'm loading jQuery on the Document Ready function, and defining $jQ at that point as well. 

Any reason why this wouldn't work?

Thanks in advance
Michael Douglas
 
Tags (1)
6 REPLIES 6
Josh_Hill13
Level 10 - Champion Alumni

Re: Follow-up page based on checkbox

Michael,

If you do a search for form page redirects or similar terms you'll find some discussions to help. You can definitely do this, but I am unsure about the exact code.
Anonymous
Not applicable

Re: Follow-up page based on checkbox

The Change a Form's Follow Up Page Dynamically help article may be what you are looking for if you haven't already found it.
Anonymous
Not applicable

Re: Follow-up page based on checkbox

Hi Michael,

I'm wondering if you've gotten any traction on this. I've recently been trying to do something similar and have found no luck as well. Thanks. 
Anonymous
Not applicable

Re: Follow-up page based on checkbox

I, too, initially learnt how to overrride the return page using Javascript by following this article Change a Form's Follow Up Page Dynamically

However, there is one important piece of information not mentioned from the article.  If your form's Follow-up Type is configured for an internal Marketo landing page, you need to set the hidden form field variable "returnLPId" to "-1".  So the Javascript code you need is the following,

$jQ("input[name='returnURL']").attr('value','http://www.yourcompany.com');
$jQ("input[name='retURL']").attr('value','http://www.yourcompany.com');
$jQ("input[name='returnLPId']").attr('value','-1');


If the field "returnLPId" holds a valid Marketo page ID, Marketo will ignore the fields returnURL and retURL, and return the page indicated by the page ID.  By setting that field to -1, Marketo would turn to the fields returnURL and retURL for the return page to use.

For forms that are configured to use an external landing page for the Follow-up Type, the form field "returnLPId" is set to -1 by Marketo.

I learnt this by following this thread https://community.marketo.com/MarketoDiscussionDetail?id=90650000000PaNKAA0

Hope this helps.
Erin_Van_Leer
Level 1

Re: Follow-up page based on checkbox

This is what was missing for me. Does your solution still allow the default follow-up page to be set and the landing page level? I'd like to be able to maintain the current follow-up page selections on our form landing pages and simply append a utm to the end of the resolved url when certain field values are selected. Also, does this work when the "if known visitor" feature is in use since the visitor doesn't actually submit any field values?

Grace_Brebner3
Level 10

Re: Follow-up page based on checkbox

Hey Erin - you're replying to a 6 year old thread and a deactivated user, you might want to start a new thread to get an answer to your question from active members of community (you can reference this thread in it if doing so helps give context).