浏览器如何确定哪些表单字段是用户名/密码? [英] How does the browser decide which form fields are username/password?

查看:76
本文介绍了浏览器如何确定哪些表单字段是用户名/密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现代浏览器保存密码.哪些标准会影响这一决定?

Modern browsers save passwords. Which criteria affect this decision?

背景:

我有一个注册页面,格式如下:

I have a registration page with the following form:

    <form action="/BlaBla/Account/Register" method="post">
    <div>
        <fieldset>
            <legend>Account Information</legend>
            <p>
                <label for="username">
                    Username:</label>
                <input id="username" name="username" type="text" value="" />
            </p>
            <p>
                <label for="email">
                    Email:</label>
                <input id="email" name="email" type="text" value="" />
            </p>
            <p>
                <label for="invitationCode">
                    Invitation Code:</label>
                <input id="invitationCode" name="invitationCode" type="text" value="" />
            </p>
            <p>
                <label for="securityQuestion">
                    Security question:</label>
                <input id="securityQuestion" name="securityQuestion" type="text" value="" />
            </p>
            <p>
                <label for="securityAnswer">
                    Security answer:</label>
                <input id="securityAnswer" name="securityAnswer" type="text" value="" />
            </p>
            <p>
                <label for="password">
                    Password:</label>
                <input id="password" name="password" type="password" />
            </p>
            <p>
                <label for="confirmPassword">
                    Confirm password:</label>
                <input id="confirmPassword" name="confirmPassword" type="password" />
            </p>
            <p class="buttons">
                <input type="submit" value="Register" />
            </p>
        </fieldset>
    </div>
    </form>

Mozilla似乎认为securityAnswerpassword字段是user/pw字段,带来了尴尬的后果(存储为用户名的安全答案是错误的).

Mozilla seems to think that the fields securityAnswer and password are the user/pw fields, with awkward consequences (security answer stored as username is bad).

推荐答案

我猜它假设'password'上方的字段是用户名.您可以尝试重新订购它们.

I'd guess it assumes the field above 'password' is the username. You could try re-ordering them.

这篇关于浏览器如何确定哪些表单字段是用户名/密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆