Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Reset fields on page reload

Options
  • 04-08-2011 4:29pm
    #1
    Registered Users Posts: 1,657 ✭✭✭


    Is there a way of forcing the browser to reset all form fields when the user reloads a page?

    i.e. I have a page and if the user fills out some of the form and changes the state of some of the buttons (e.g. to "disabled"), then they reload the page, I want it to be like they first load the page - all buttons enabled and all fields clear.

    In Firefox, this happens correctly if I put my cursor in the address bar and hit return (i.e. load the same page again), but if I click on the refresh button, the fields retain the data and disabled buttons are still disabled...


Comments

  • Registered Users Posts: 1,657 ✭✭✭komodosp


    Aahh with a bit more searching I found that php code..
    header("Cache-Control:no-store");
    

    Does the trick!


Advertisement