Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a form field to begin empty

Status
Not open for further replies.

TheDust

Programmer
Aug 12, 2002
217
0
0
US
Hi...

I was wondering how you can prevent a textbox from populating with a user's previous entry. This is for a password field. I want the user to have to type in the password EVERY SINGLE TIME before logging in. However, the field keeps getting populated when I tell my browser to remember my login information.

I've tried setting the field's value to "", but to no avail. Does anyone think Javascript could save me here?
 
However, the field keeps getting populated when I tell my browser to remember my login information

Don't tell it to remember your login information. That's what it's meant to do when you tick that box.

Less flippantly, how is it remembering the info? Via a cookie?
If so find where in the code the cookie is being written and remove the bit that is storing the password.

If it's simply a variable being put into the value attribute of the input box then remove that attribute value.

It could also be a caching issue. Check your browser's cache settings.

Foamcow Heavy Industries - Web design and ranting
Toccoa Games - Day of Defeat gaming community
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
"I'm making time
 
I'm using PHP, but I'm not setting a cookie or a session variable to remember the password. I'm not giving the option to the user either. So I think that Mozilla is just remembering the password on its own. Is there no way to set the field empty at runtime with some Javascript?
 
Mozilla has its own built-in password manager that will remember values. Since you chose to remember the values, the values got remembered. I don't know why you chose to remember the values if you didn't want that functionality. If you still want to delete it from your system, go to Tools -> Password Manager -> Manage stored passwords and select yours and remove it.
 
<form action="Login" method="POST" autocomplete="off">
 
Presumably you want to prevent other users from using the Mozilla password manager. My guess is that you can't, any more than you can prevent them writing their password down on a post-it and sticking it near the screen. Not everyone's going to treat your password with the respect you think it deserves - live with it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Thanks for all of the advice guys... I'll implement what I can and the rest I'll live with no problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top