【问题标题】:Ionic / Angular : unable to disable password input auto completeIonic / Angular:无法禁用密码输入自动完成
【发布时间】:2014-09-02 03:37:38
【问题描述】:

我正在使用 Ionic Framework / Angular / Cordova 设计应用程序,但在清除旧表单值时遇到问题。

当用户登录时,他会被路由到另一个视图,但当他们切换回登录视图(断开连接后)时,登录和密码字段仍然填充旧值。

所以我知道这个问题在这里被问了很多次,主要的解决方案是设置输入属性:

autocomplete="off"

但这没有任何效果。 我也加了

document.getElementById('password').value = '';

在登录控制器中没有变化。

如何清除这些值?

【问题讨论】:

  • 请向我们展示完整的<input> 定义

标签: angularjs autocomplete ionic-framework


【解决方案1】:

在 js 中使用自动补全并输入这一行:

 someFormElm.setAttribute( "autocomplete", "off" );

前:

<input type="text" name="fieldName" id="fieldId" class="firstCSSClass otherCSSClass autocompleteOff" />

JS:

$(document).ready(function(){$("input").attr("autocomplete","off");});

【讨论】:

  • 仍然没有变化...我相信因为浏览器已经保存了值,现在它会一直显示..我正在寻找一种解决方案来清除每种情况下的值..
猜你喜欢
  • 2021-11-06
  • 2019-07-12
  • 2021-08-20
  • 2017-08-25
  • 2019-03-21
  • 2021-08-14
  • 1970-01-01
  • 1970-01-01
  • 2018-02-22
相关资源
最近更新 更多