File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Preventing from browser caching data?

 
Mallik Avula
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Friends
We enter data into some text field and submitted. When we comeback to that page and enter a character, it will display all previous entered data which start with that character.
How to prevent this?
Can any body help me?
thanks in advance
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add autocomplete="off" to the form element. It will keep the browser from showing the information.

Eric
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does autocomplete work for Firefox as well or is that just an IE thing? In my case I use mostly Struts tags which do not support the autocomplete attribute so I had to come up with a different solution. My solution was to use the following call to disable autocomplete for all fields on the form:

form.setAttribute("autocomplete","off");

- Brent
 
Paul Clapham
Sheriff
Pie
Posts: 20171
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Autocomplete works in my copy of Firefox. But don't you have Firefox installed on your computer? If you have this question, then really you should install it, so you can test your application in it.
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I threw out my solution because it seems slightly more standards compliant. But then again auto-completion of fields is not a defined standard so I am not sure there is really a way to do something non-standard and still stick with the standards. In my case, adding an autocomplete attribute to input tags causes XHTML validation messages and does not work when using Struts custom tags so setting the attribute on the form worked for me.

- Brent
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic