Results 1 to 8 of 8

Thread: Passwords and Recall Form Values script II

  1. #1
    Join Date
    Apr 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Passwords and Recall Form Values script II

    Recall Form Values script II
    http://www.dynamicdrive.com/dynamici...mremember2.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

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ok, this has not been thoroughly tested, though the below should work. Locate the line:

    Code:
    if (this.fields[i].type=="text")
    and change that to:

    Code:
    if (this.fields[i].type=="text" || this.fields[i].type=="password")
    Then, locate the line:

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

    Code:
    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:

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Apr 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That work great

    Thanks for the quick reply

  7. #7
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  8. #8
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Please help with this problem. I would really like to be able to save the password value in my form.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •