www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: simulate password box

  1. #1
    Join Date
    Mar 2010
    Posts
    18

    simulate password box

    There are situations where I want autocomplete to work for a user's name and password, and situations where I don't. In Firefox, even with autocomplete off, once the user fills in his name, the browser supplies the password field filled out.

    I would like to be able to simulate the just-print-asterisks behavior of the input-password form element in an input-text box so as not to trigger the browser's 'helpful' behavior. Does anyone have a little JS snippet that will do this?

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,377

  3. #3
    Join Date
    Mar 2010
    Posts
    18

    Thanks, but ...

    Let me state the problem more completely: In my application I want people to be able to use autocomplete once, when they first attempt to log in. But on subsequent attempts, or when they have timed out through inactivity and are re-logging on a different screen, I don't want autocompletion to work (Think multi-user public computers). Since the browser has already stored a password, even though I have turned off autocompletion on this second screen, if the (perhaps next and unauthorized) user guesses the name of the previous log-in, the browser still provides the stored password. I suspect this mechanism is built around the password-type input element, and so I want to eliminate that on my secondary login screen.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Generate a random name for the password field. The server program can easily store and read the value.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Mar 2010
    Posts
    18
    Tried that of course. Firefox seems not to care about the name of the element, only that it is of type password. So, for example, I logged in and asked Firfox to remember the password I had types. Then wen to the app and changed the name of the password element. After relaoding the app I tried logging in again - and Firefox was obsessive enough to provide the password anew to the newly-named box.

  6. #6
    Join Date
    Jan 2009
    Posts
    3,346
    Have you tried using a random string for the name of the "username" field or whatever you call it? That should confuse FF enough to not provide the password.

  7. #7
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    There is an exception when autocomplete will not work: https://developer.mozilla.org/En/How...ed_Workarounds
    At least 98% of internet users' DNA is identical to that of chimpanzees

  8. #8
    Join Date
    Mar 2010
    Posts
    18
    @criterion
    You'd think so, but it does not - at least not in my tests.

  9. #9
    Join Date
    Mar 2010
    Posts
    18
    Wow. I thought you were really on to something there. After reading the info I tried renaming the form, the input box, and the password box. But no luck: as soon as I typed the first couple of characters in the randomly-named name field, Firefox gave me a drop-down with the field completed; and as soon as I choose that dropdown, it inserted my password in the randomly-named password field below.

    It looks like they're storing data elated to the content of a box - regardless of name - and associating that with a password. Argh!

    Thanks for your continuing interest.

  10. #10
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Do you have Google Toolbar autocomplete?
    At least 98% of internet users' DNA is identical to that of chimpanzees

  11. #11
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    This is not typical behavior for any unmodified browser that I'm aware of. Could you enumerate your add-ons and other modifications?
    Last edited by svidgen; 03-18-2010 at 02:08 PM. Reason: and/or => and
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  12. #12
    Join Date
    Mar 2010
    Posts
    18
    Sure: Firefox 3.6 with TACO and ColorfulTabs. The behavior is the same on another machine w/o the add-ons and which I never use.

    Neither browser has been explicitly modified.

  13. #13
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Why don't we try this ... give us the URL, and we'll see if we see the same behavior on our browsers. We can also see the source then and verify that there's nothing atypical about the way you're defining your username/password fields.
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  14. #14
    Join Date
    Mar 2010
    Posts
    18
    Good idea. So I wrote a very simple test case to prove how right I was. And it does not fail in the manner I described. I need to do some more research!
    I'll get back to the thread when I have a simple example or a complicated explanation. Thanks for your interest.

  15. #15
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    If you still need help when you return to the thread, the "simple example" would be preferred over the "complicated explanation."
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles