2 Replies Latest reply on Jul 6, 2017 5:34 AM by Michael Ramos

    Form Fields in External URL

    Michael Ramos

      The goal is:

      Upon submitting a form, I would like to use the form values in the External URL creation.  &firstname={{my.token.firstname}} for example.

      Can someone point me to directions on how to load my.tokens to support this.

       

      http://prntscr.com/fs1op3

       

       

      Only text my.tokens are supported in follow-up page URLs and will only work within Marketo landing pages.

        • Re: Form Fields in External URL
          Sanford Whiteman
          MktoForms2.whenReady(function(form){   
            form.onSuccess(function(vals,tyURL){     
              var queryFromVals = Object.keys(vals).reduce(function(p,n,i){       
                return p +         
                  ( i ? '&' : '?' ) +         
                  [n,vals[n]].map(encodeURIComponent).join('=')     
                },'');      
          
              tyURL += queryFromVals;
              document.location.href = tyURL;
              return false;
            }); 
          });