如何在网站上的多个登录字段上使用自动填充 [英] How to use autofill on multiple login fields on a website

查看:67
本文介绍了如何在网站上的多个登录字段上使用自动填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网页上有两个单独的登录字段时,我的浏览器(Google Chrome)假定它们都需要相同的凭据,但这不是有效的假设.我希望浏览器将凭据分别存储到它们中.

When having two separate login fields on a webpage, my browser (Google Chrome) assumes that both of them require the same credentials, which is not a valid assumption. I would have liked my browser to store the credentials to each of them separately.

<form id='login-form' method = "post" action = "/login.html">
    <ul>
        <li><input id = "username" name = "username" type = "text" placeholder = "Username"/></li>
        <li><input id = "password" name = "password" type = "password" placeholder = "Password"/></li>
        <li><input id = "button" type = "submit" value = "Login"/></li>
    </ul>
</form>

在另一个HTML页面上:

On another HTML page:

<form id='dx-login-form' method = "post" action = "/dxLogin">
    <ul>
        <li><input id = "dx_username" name = "dx_username" type = "text" placeholder = "Username"/></li>
        <li><input id = "dx_password" name = "dx_password" type = "password" placeholder = "Password"/></li>
        <li><input id = "button" type = "submit" value = "Login"/></li>
    </ul>
</form>

推荐答案

您可以为第二个登录表单提供不同的自动完成标识符,这样它就不会从第一个登录表单中自动填充.

You can give the second login form different autocomplete identifiers so it won't auto-fill from the first login form.

    <li><input id = "dx_username" name = "dx_username" type = "text" placeholder = "Username" autocomplete = "dx_username" /></li>
    <li><input id = "dx_password" name = "dx_password" type = "password" placeholder = "Password" autocomplete = "dx_password" /></li>

有关更多信息: https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill

这篇关于如何在网站上的多个登录字段上使用自动填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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