【问题标题】:Firefox bug with input type password?输入类型密码的Firefox错误?
【发布时间】:2016-03-16 08:19:35
【问题描述】:

我正在开发的应用程序中存在问题,如果我的输入字段类型为“密码”,那么另一个输入字段将填充来自完全不同元素的数据。

如果我将“密码”元素的类型设置为“文本”,则没有问题。

不幸的是,我无法发布 jsFiddle 的示例,但我四处搜索,发现其他人在使用旧版本的 Firefox 时遇到问题。

我正在使用版本:43.0b9 和 Firebug 2.0.13

IE、Chrome 和 Safari 不会在加载完全相同的页面时执行此操作,但它在 FireFox 中非常可重复且非常可靠。

我已经设置了属性 autocomplete="off" 但没有区别。

这个问题让我摸不着头脑...我已经注释掉了几乎所有内容,但问题仍然存在,我的姓名和登录密码如何找到两个 INPUT 元素,Chrome 中的同一页面, IE 和 Safari 不这样做。

【问题讨论】:

  • 您是否记得您是否找到了解决方案?

标签: firefox input passwords


【解决方案1】:

我遇到了同样的问题,在阅读了其他类似问题的答案后终于解决了:https://stackoverflow.com/a/10745884/6938721

在我的例子中,我有很多输入字段分为多个字段集,并通过 AJAX 发送。

嗯,解决方案是用<form>...</form> 标签包围每个<fieldset>...</fieldset>

最初我有类似的东西:

<fieldset>
    <input type="text" name="field1">
    <input type="password" name="field2">
    <input type="password" name="field3">
</fieldset>

<fieldset>
    <input type="text" name="field4">
    <input type="password" name="field5">
    <input type="password" name="field6">
</fieldset>

应用解决方案后,我得到:

<form>
    <fieldset>
        <input type="text" name="field1">
        <input type="password" name="field2">
        <input type="password" name="field3">
    </fieldset>
</form>

<form>
    <fieldset>
        <input type="text" name="field4">
        <input type="password" name="field5">
        <input type="password" name="field6">
    </fieldset>
</form>

编辑:

关键是在&lt;form&gt; 块内输入的密码不能超过 3 个。该文档本身用作&lt;form&gt;

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-10
    • 2014-09-10
    • 1970-01-01
    • 2014-02-13
    • 2017-03-27
    相关资源
    最近更新 更多