Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Preventing from browser caching data?

 
Mallik Avula
Ranch Hand
Posts: 86
  • 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
  • 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
  • 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
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic