SOLVED

Form Prefill Persist on refresh

Go to solution
Kele_Powell
Level 1

Form Prefill Persist on refresh

I am currently working on building a Subscription Center with a Marketo Landing page. The Subscription center has prefilled fields to show the lead what they are currently subscribed to. This all works well when a lead comes from an email, but if I refresh the page all the prefill fields are no longer prefilled.

I understand that this is by design with the Prefill update that happened in the latter half of 2019. 

Is it possible to correct this and allow the prefills to persist on page refresh? I am also hoping that this could serve as a dual purpose to allow a lead to navigate from an unsubscribe center instead. of having to come directly through an email. Something like Sanford's solution to https://blog.teknkl.com/pre-fill-any-site-any-form/ ?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Prefill Persist on refresh

Yes, use my code for this.

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Prefill Persist on refresh

Yes, use my code for this.

Kele_Powell
Level 1

Re: Form Prefill Persist on refresh

@SanfordWhiteman Are the steps any different for using this for internal landing pages, and does it matter if I host your code in Marketo? Trying to implement your solution, I could not get the data to persist. It may also be that I put the script on the landing page in the incorrect place. http://na-sj31.marketo.com/lp/538-CCU-524/pref_test.html

 

Also if I wanted to have this work going from the unsubscribe page to the preference page, would I need to add the DTO helper code to both pages?

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Prefill Persist on refresh

Just treat the Marketo LP as if it were an external page — nothing special should be done.

 

Using the DTO ensures portability, so if you move to an external website nothing has to change.

 

Your sample DTO has a non-matching domain name (you left the default example.com).

Kele_Powell
Level 1

Re: Form Prefill Persist on refresh

Thanks for catching that. I made that update, but when I refresh the page I still lose my prefill data.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Prefill Persist on refresh

You also have to go to the secure (https) version of the (outer) page. Your link is to the plain-text (http) page.

Jay_Jiang
Level 10

Re: Form Prefill Persist on refresh

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Prefill Persist on refresh

Jay, your code doesn't deal properly with HTML encoding.