If you have a web form and don’t want a users input to be saved by a browser for repeated entry later then you need to employ autocomplete attribte of a form.
The HTML below will give you a simple form that the browser should not prompt the user to save the credentials.
You should note, this is not standards compliant, but it does seem to work in chrome, IE and firefox.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<title>Prevent Autocomplete</title>
</head>
<body>
<form id=”payment” autocomplete=”false” action=”#” method=”post”>
<p><label for=”Name”>Name on Credit Card</label><input type=”text” id=”Name”/></p>
<p><label for=”CCNum”>Creditcard Number </label><input type=”text” id=”CCNum”/></p>
<p><label for=”Expiry”>Expiry Date</label><input type=”text” id=”Expiry”/></p>
<input type=”submit” />
</form>
</body>
</html>
2 comments
Comments feed for this article
1 July 2009 at 2:41 pm
Chris Eargle
I wish I knew about that a few years ago. I had a client complain about the yellow boxes. So, I recommended she stop using FireFox! ::ducks the bricks from the FF users::
7 June 2010 at 3:59 pm
Jeremy Walker
You can also do this on individual input boxes. Useful where you maybe have one server-side powered drop-down but want the browser to handle autocomplete on the rest. Same code, just on input.