Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
592 views
in Technique[技术] by (71.8m points)

html - autocomplete = 'off' is not working on firefox

I created 2 login pages of same domain.

  1. www.example.com/login.cfm
  2. www.example.com/newLogin.cfm

I put the form name different for 2 forms with in these two page. Also I put autocomplete = 'off' for the second form and for the text fields within that form.(But it is on for first form ).

Now if I save the username and password at the time of login from www.testDomain.com/login.cfm in browser, then the list of usernames are auto populating in the username field of second login page even if the auto Complete is off. I need to block this for security reasons. Is there any way to do this? I am using FireFox V21.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is the cleanest solution I have found to keep Firefox from auto completing.

 <!-- The text and password here are to prevent FF from auto filling my login credentials because it ignores autocomplete="off"-->
 <input type="text" style="display:none">
 <input type="password" style="display:none">

Add this code snip-it above your input of type password.

As far as I can tell Firefox is looking for an input of type Password, and filling in the password and then adding the username to the input of type text above it. Without a name or an id the inputs don't get added to the post, but this is still a hack.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...