【问题标题】:AutoComplete field and IE自动完成字段和 IE
【发布时间】:2011-01-05 16:11:39
【问题描述】:

我的网页没有autocomplete 属性,该属性会告诉浏览器不要自动完成该字段。尽管没有这个属性,IE 8 或 Safari(在其他浏览器上不确定)不会自动完成页面。

自动完成功能在某些网站(例如 Gmail)上确实有效,所以我假设浏览器设置没有导致它?

代码如下:

      <tr>
        <td>User Id</td>
        <td><input name="userId" type="text" id="userId" runat="server" /></td>
      </tr>
      <tr>
        <td>Password</td>
        <td><input name="password" type="password" id="password" enableviewstate="false" runat="server" /></td>
      </tr>

【问题讨论】:

  • 你的 HTML 是什么样的?你的领域叫什么名字?你能在其他浏览器上查看吗?
  • 是的,我们需要查看代码。某些表单可能会混淆自动填充器的原因有很多,例如当您从 JavaScript 动态创建表单时。

标签: asp.net html internet-explorer autocomplete


【解决方案1】:

自动完成功能是特定于浏览器的,其行为可能会有所不同,具体取决于页面是否通过 HTTPS 传递和/或是否使用标头或元标记禁用缓存。见http://msdn.microsoft.com/en-us/library/ms533486%28VS.85%29.aspx。浏览器工具栏或插件的存在(或不存在)会使问题进一步复杂化。

作为网页开发人员,您只能做很多事情来允许这种行为,并且指定name 属性而不指定autocomplete=off 是您所能做到的。

【讨论】:

    【解决方案2】:

    尝试改变
    &lt;input name="userId" type="text" id="userId" runat="server" /&gt;

    &lt;input name="username" type="text" id="userId" runat="server" /&gt;

    某些浏览器可能未将“userId”检测为登录表单的一部分。

    【讨论】:

      猜你喜欢
      • 2012-06-12
      • 2012-10-23
      • 1970-01-01
      • 1970-01-01
      • 2017-08-10
      • 1970-01-01
      • 2013-01-08
      • 1970-01-01
      • 2010-10-15
      相关资源
      最近更新 更多