MuhuPower
MuhuPower

Reputation: 414

jquery - Clear form input data when history back

I have an ipad Mini setup at this link for a client of mine. http://www.messtudios.com/k/ginosnesconset/kiosk/mini/

When the customer submits an email address it goes to a "please confirm page" then history back after 3 seconds.

The problem is the email address is still in the input field - we need to clear that so other customers don't see the address if mini is passed around.

A simple value = "" doesn't work because the "history back" doesn't actually refresh the page.

I can't use a redirect after 3 seconds to fo to the URL for a refresh because I have another kiosk that uses the same code on the confirmation page that links to a different URL.

My friend said to do something with the history function - instead of history back, he said to get the URL of the history back and redirect to that somehow..

Can anyone help? I will make a jfiddle if needed.

Thanks, -O

Upvotes: 2

Views: 2417

Answers (2)

Steven V
Steven V

Reputation: 16595

This is probably because the browser is caching the form. Try disabling the cache by setting the HTTP headers on the form, or adding some META tags. Take a look at Using <meta> tags to turn off caching in all browsers? for an example of the meta tags.

Upvotes: 0

Musa
Musa

Reputation: 97727

Try adding the autocomplete="off" attribute to the input.

Upvotes: 5

Related Questions