SOLVED

Not able to add LeadSource standard SFDC field in Marketo Form

Go to solution
SanfordWhiteman
Level 10 - Community Moderator

Re: Not able to add LeadSource standard SFDC field in Marketo Form

More resiliently:

   form.onSuccess(function(submittedValues,originalThankYouHref){
      let originalThankYouURL = new URL(originalThankYouHref);
      let overrideThankYouURL = new URL("https://www.example.com");
      
      for(const qp of originalThankYouURL.searchParams.entries()){
         overrideThankYouURL.searchParams.append(...qp);
      }
      
      location.href = overrideThankYouURL;
      
      return false;
   });

 (You don't want to lose the aliId if the Thank You URL happens to be a Marketo LP.)

SanfordWhiteman
Level 10 - Community Moderator

Re: Not able to add LeadSource standard SFDC field in Marketo Form

Is that field actually on the form in Form Editor?