
提交登陆等表单时,许可记录了密码则会留存起来,且每次城市自动挖充入input,我们有时候不需要自动挖充,试过网上的各类圆法都没能完善解决,最后终于找到解决举措,兴话未几说,直接上代码!
<form method="post" action="">
<input type="text" name="username" readonly="readonly" id="username">
<input type="password" name="password" readonly="readonly" id="password">
<input type="submit" value="登录">
</form>
<script>
setTimeout(function removeReadonly(){
var username=document.getElementById("username");
var password=document.getElementById("password");
username.removeAttribute("readonly");
password.removeAttribute("readonly");
},1000);
</script>
思路:首先设置input为只读readonly,当页面加载完成后,欣赏器不会自动挖充内容,可是也不可以停止编纂。然后我们再用js的准时器延早一段时候后移除input的只读属性readonly,输入框便可停止再次编纂!完善解决!
转载请注明: 帝国CMS模板 » html禁行自动挖充input表单的完善解决圆法
*
回帖描述:*
链接类型:*
下载链接:*
描述:*
回帖描述:*
链接类型:*
阅读权限:*
下载链接:



聚优部落技术论坛 © 版权所有 鲁ICP备15007479号-6
Copyright(C)web.com, All Rights Reserved.
