4 Replies Latest reply on Apr 30, 2013 5:26 PM by 34148

    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
            
        • Re: Follow-up page based on checkbox
          Josh Hill
          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.
          • 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.
            • 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. 
              • 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.