PDA

View Full Version : Passwords and Recall Form Values script II



megapsyk
04-06-2006, 12:47 PM
Recall Form Values script II
http://www.dynamicdrive.com/dynamicindex16/formremember2.htm


I'm using this script to remember users and passwords to log onto a site.

It will only save the password in type="text" and not in type="password"
I need to use the password field to star out the user's passwords.

Is there any easy way to modify this script to use the password type as well as text?

I am pretty much in the dark when it comes to javascript.

Thanks

ddadmin
04-06-2006, 07:18 PM
Ok, this has not been thoroughly tested, though the below should work. Locate the line:


if (this.fields[i].type=="text")

and change that to:


if (this.fields[i].type=="text" || this.fields[i].type=="password")

Then, locate the line:


if (cookievaluepair[i].split(":")[0]!="toggleboxid" && this.getfield(cookievaluepair[i].split(":")[0]).type=="text")

and change that to:


if (cookievaluepair[i].split(":")[0]!="toggleboxid" && this.getfield(cookievaluepair[i].split(":")[0]).type.search(/text|password/i)!=-1)

Or if you don't want to change things manually, here's the modified version of formretain2.js:

Twey
04-06-2006, 07:28 PM
But this will store the user's password in plaintext format on his/her hard drive, which is not a good idea and, I suspect, the reason that this modification isn't default.

ddadmin
04-06-2006, 09:05 PM
Yes this was my concern, how the password would be stored as plain text in the user's browser's cookie file. I can't say whether this is neccessarily a security problem to the user filling out the form by default though. Anyone have a scenerio of this?

Twey
04-06-2006, 11:01 PM
Many, especially on public computers. With *n?x systems, the default behaviour tends to be to keep users seperate from one another, but on Windows computers it's almost always possible for a user to go browsing through another's cookies and application data. When the browser saves passwords, it stores them in an encrypted form, the key to which is either the master password (Firefox) or the user's logon password (Internet Explorer). I don't know how other browsers implement this. I suggest you let the browser handle storing passwords, as it will do it much better than you can. :)

megapsyk
04-07-2006, 01:50 PM
That work great

Thanks for the quick reply

trippin
02-05-2007, 06:13 AM
I have updated my script file with the one provided by ddadmin and it will still only save the screenname and not the password. I am thinking it is because I dont have a submit button on my login form. I have a button with an onclick property which passes a function to submit the form along with a few other things. Is this the reason it isn't working for me?

trippin
02-06-2007, 02:53 AM
Please help with this problem. I would really like to be able to save the password value in my form.