开发者

Influencing whether browsers prompt to save credentials

For most web pages that have a username and password dialog, browsers will prompt the user if they want to save the credentials for that f开发者_StackOverflow社区orm:

Influencing whether browsers prompt to save credentials

However, for this login page, it doesn't. I can't find any good data on how IE makes the decision whether to present this dialog. How to get IE to show that prompt - assuming no user settings trump it?


My guess is that since the page is in HTTPS mode IE is not allowing autocomplete to execute because the page has indicated that HTTP caching should not be allowed.

Or the form is being submitted with Javascript.

See this article for more details. http://blogs.msdn.com/b/ieinternals/archive/2009/09/11/troubleshooting-stored-login-problems-in-ie.aspx


When IE is configured to ask you the question, then it will ask or not depending on the way you submit the form.

When submiting using an input type="submit" (i.e. a submit button), then IE will ask you if you want to save the password.

If you use javascript to submit the form, like this document.getElementById('Form1').submit(), it will not ask you to save the password.

Try this HTML, in IE (I didn't test other browser yet):

  • the submit button asks you to save password
  • the submit link does not ask anything

Html code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1">
    <title>Home Page </title>
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form method="post" action="Default.aspx" id="Form1">
    <div class="aspNetHidden">
        <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODcyMTYwNTY0ZGRfKmsji5yH9OZWyNlRsIwCOz1mu6uALjmUI+04ei8bkQ==" />
    </div>
    User:
    <input name="ctl00$BodyContent$login$UserName" type="text" id="ctl00_BodyContent_login_UserName"
        class="user-name">
    Pass:
    <input name="ctl00$BodyContent$login$Password" type="password" id="ctl00_BodyContent_login_Password">
    <input type="submit" value="Submit">
    <a href="javascript:document.getElementById('Form1').submit();">submit</a>
    </form>
</body>
</html>

If you check the box to never ask again, then you can configure that in IE options:

Tools > Internet Options > Content > AutoComplete

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜