【问题标题】:how to disable google chrome suggestion list when using twitter bootstrap typeahead?使用 twitter bootstrap typeahead 时如何禁用 google chrome 建议列表?
【发布时间】:2012-03-05 11:00:47
【问题描述】:

使用 twitter bootstrap typeahead 我在 typeahead 列表上方获得 google chrome 建议列表

 $(document).ready(function () {
        $("[ID$=TextBox]").typeahead({ source: ["aaa", "aab", "aac", "aad"] });
    });

<asp:TextBox ID="TextBox" runat="server" data-provide="typeahead"></asp:TextBox>

【问题讨论】:

  • 你试过在输入框设置autocomplete="off"吗?
  • 你是对的请写成答案

标签: asp.net google-chrome twitter-bootstrap typeahead


【解决方案1】:

[以上评论部分的跟进]

您可以通过关闭自动完成功能来关闭引用字头的输入框上的该功能,如下所示:

autocomplete="off"

【讨论】:

  • 为了清楚起见,请注意“自动完成”仅适用于 HTML5,因此如果您使用其他 DOCTYPE,它将无法验证。
【解决方案2】:

正如 Andres Ilich 所提到的,添加 autocomplete="off"attribute 应该可以解决问题。 W3草案中提到: http://www.w3.org/Submission/web-forms2/#the-autocomplete

我对 ASP.NET 了解不多,所以不知道标签中是否支持该属性。当我浏览 w3school (http://www.w3schools.com/aspnet/prop_webcontrol_textbox_autocompletetype.asp) 时,我得到了这个熟悉的选项AutoCompleteType="None"。但我不确定。

我认为在 jQuery 中你可以实现这样的东西:

$("[ID$=TextBox]").attr("autocomplete", "off");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多