Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Form data should not be displayed on clicking back button  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm working on a application where the user will enter his data and submits the application. If he misses out any mandatory field he will be asked to fill it and re-submit. After re-filling the form and submitting the form if he clicks on the back button, all the form-data is still visible. I donot want this to happen. If he clicks back button then he should be displayed with blank form. This is working if he submits the form correctly without missing the mandatory data. Request you to help me out.
FYI.. I've used all the below options.. but it did not work. Quick response is highly appreciated.

httpResponse.setHeader("Pragma","no-cache");
httpResponse.setHeader("Cache-Control","no-store");
httpResponse.setHeader("Expires","0");
httpResponse.setDateHeader("Expires",-1);
httpResponse.setHeader("Cache-Control","no-cache");
httpResponse.setHeader("Cache-Control", "max-stale=0");
httpResponse.setHeader("Cache-Control", "private");
httpResponse.setHeader("Cache-Control","must-revalidate");
httpResponse.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
httpResponse.setHeader("Cache-Control","post-check=0, pre-check=0");
 
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you tell how your form is written ?
 
Ramesh Chandra
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was not written in the form.. i wrote that one in the Filter class.
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add the following code(after replacing your form name) to the end of your form.

<script language="JavaScript">
document.putYourFormName.reset();
</script>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!