表单报错:Password field is not contained in a form

花烨
2023-12-01

控制台报错:
1、Password field is not contained in a form
2、Input elements should have autocomplete attributes (suggested: “new-password”)
1的解决方法就是在input标签外层嵌套一个form标签就ok,

<form>                           
  <input type="password" class="form-control" id="oldpwd" placeholder="原密码">                           
</form>

2的解决方式是在input标签上加一个属性autocomplete=“off”

<form>                           
    <input type="password" class="form-control" id="oldpwd" placeholder="原密码" autocomplete="off">                           
</form>

参考文章:https://blog.csdn.net/cc6_66/article/details/108780690

 类似资料: