SOLVED

How to clear out form field info on page load

Go to solution
John_Wallace
Level 4

How to clear out form field info on page load

0EM50000000T3yW.png

Hi I have created a landing page we are going to use at PyCon this year for people to create accounts for our product.  We are going to have this on a Ipad at our booth and pass it to people who are interested in signing up.  I was looking for a way to have no prefil text inside the form fields.  I disabled pre-fill inside the form editor and still there are forms that get preloaded with text of the last form submit.  I try using some javascript to clear out the forms but have had not luck.  The form is on a landing page that is being iframed and displayed on another landing page.  Has anyone else run into an issue similar to this and have a solution they would willing to share?  Thanks!

-John
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Justin_Cooperm2
Level 10

Re: How to clear out form field info on page load

By the way, make sure you disable pre-fill on every field in your form! I have a hunch that is what your issue could be.

View solution in original post

6 REPLIES 6
Josh_Hill13
Level 10 - Champion Alumni

Re: How to clear out form field info on page load

can you remove the munchkin code from both pages?

also disable prefill on the page
Justin_Cooperm2
Level 10

Re: How to clear out form field info on page load

Sounds like you've already seen forms docs:
http://developers.marketo.com/documentation/websites/forms-2-0/

In the onSuccess callback add one line of JS:
location.reload(true);

If your form has pre-fill disabled, then refreshing the page should make it work the way you want.
Justin_Cooperm2
Level 10

Re: How to clear out form field info on page load

By the way, make sure you disable pre-fill on every field in your form! I have a hunch that is what your issue could be.
John_Wallace
Level 4

Re: How to clear out form field info on page load

Annnnd.....I am an idiot.  Did not turn off pre-fill on all the fields, works like a charm now.  Thanks guys
SanfordWhiteman
Level 10 - Community Moderator

Re: How to clear out form field info on page load

@Justin C One last thing: I feel this should be in the onSuccess rather than the onSubmit to make sure it can't abort the async form post.
Justin_Cooperm2
Level 10

Re: How to clear out form field info on page load

Sanford is correct, onSuccess() in the right way to do this.