我有一个简单的表单,我需要用角度表单禁用自动填充/自动完成。
我在 StackOverflow 上搜索过,但没有找到解决方案。
我使用了 autocomplete=“off” 或 autocomplete=“false” 但自动完成从未被禁用。
有时,当我加载页面时,自动完成功能会暂时禁用。但是,一段时间后,当我重新加载页面时,问题再次出现。
//来自上图的标记
<input type="text" class="form-control input-lg ng-pristine ng-empty ng-invalid ng-invalid-required ng-touched" capitalize-full="" ng-model="user.ENDERECO" required="" placeholder="Digite seu endereço" autocomplete="off" name="street" style="opacity: 1; text-transform: uppercase;">
//标记示例
<form class="form form-horizontal" name="regForm"
autocomplete="false" novalidate role="form">
<input type="text" class="form-control input-lg"
name="cpf" ng-model="user.CPF" placeholder="Digite seu CPF"
required autocomplete="false" >
</form>
原文由 Luiz Alves 发布,翻译遵循 CC BY-SA 4.0 许可协议
2018 年 4 月:设置
autocomplete="off"
对我有效(在 Chrome 上测试)。在单个元素上设置此属性不起作用。