![](/img/trans.png)
[英]How to remove html from search autocomplete input after click on search results?
[英]How to remove autocomplete from input?
我试过 autocomplete="off", autocomplete="none" , autocomplete="/" ,autocomplete="new-text" 但它仍然显示自动完成
浏览器自动完成重叠打字头自动完成弹出
我不知道如何删除此自动完成功能
先感谢您!!
<form name="clientForm" class="kt-form kt-form--label-right" novalidate role="form" autocomplete="new-text"> <div class="form-group row"> <div class="col-lg-3 col-sm-6 col-xs-12 typeahead"> <label for="country">Country <span style="color:red">*</span></label><br /> <input id="add-c-country" class="form-control" name="country" type="text" dir="ltr" placeholder="Enter Country" autocomplete="new-text" /> <div class="form-text text-muted" ng-show="clientForm.country.$touched || clientForm.$submitted" ng-messages="clientForm.country.$error" role="alert"> <div class="req-red" ng-message="required">Please Select Country</div> </div> </div> </div> </form>
我正在使用 typeahead.js 进行自动完成
function applyAutocomplete(id, array,namE) { $('input#' + id).typeahead({ hint: true, highlight: true, minLength: 1, accent: true, offset: true }, { name: namE, limit: 100, source: substringMatcher(array) }); } applyAutocomplete('add-c-country', $ctrl.countryNameList,'country');
您可以尝试完全删除自动完成参数吗?
像这样:
<input id="add-c-country" class="form-control" name="country" type="text" dir="ltr" placeholder="Enter Country" />
阅读您编辑的问题后进行编辑:
您不能在自己的代码中禁用浏览器自动完成功能。 那是浏览器特定的设置。 对于 chrome,您可以执行以下操作:
- 单击 Chrome 菜单图标。 (屏幕右上角的三行。)
- 单击设置。
- 在页面底部,单击“显示高级设置”
- 在密码和表单部分,取消选中“启用自动填充以单击即可填写网络表单”。
希望这能解决您的问题。
此致。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.