Disabling AutoComplete in text input fields

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tor Vidvei
Forum Newbie
Posts: 2
Joined: Mon Jan 21, 2008 10:00 am

Disabling AutoComplete in text input fields

Post by Tor Vidvei »

I'm developing a traning page for basic math. The answers are entered by the user in simple text input fields and the same page is returned (after having been processed by php) to the user with the results.

If the AutoComplete feature is turned on, a droplist with previous entries are displayed in the answer fields, even if new exercises are generated. This is quite disturbing. Is there any way I can block this feature from my php-code, even if it is turned on in the users browser?

Regards
Tor Vidvei
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Disabling AutoComplete in text input fields

Post by Christopher »

Take a look into the page caching headers. I think you can tell the browser not to cache the values. But browsers can try to be pretty smart. You may need to change the field input name to prevent this.
(#10850)
Post Reply