input输入框自动填充的问题

火狐浏览器打开页面,input可以自动填充历史输入值,现在想无论input类型是type=‘text‘还是’password‘都禁止自动填充,因为我写的页面在input=‘text’时先检查是否有输入值,若没有则提交按钮是灰色的不能提交的,当自动填充时,页面input框有值,但按钮还是失效状态检查不出自动填充有值,看起来体验不好,然而autocomplete=‘off‘竟然失效,解决:

<input type="text" readonly onfocus="this.removeAttribute(‘readonly‘)" />

先readonly再点击移除属性

原文地址:https://www.cnblogs.com/afei1759/p/11296955.html

时间: 2024-08-26 13:25:00

input输入框自动填充的问题的相关文章

input输入框自动填充黄色背景解决方案

chrome表单自动填充后,input文本框的背景会变成偏黄色的,这是由于chrome会默认给自动填充的input表单加上input:-webkit-autofill私有属性,然后对其赋予以下样式: input:-webkit-autofill { background-color: #FAFFBD; background-image: none; color: #000; } 之前有一种解决方案是禁用autocomplete属性 <input type="text" name=

DataList:HTML5中的input输入框自动提示宝器

DataList的作用是在你往input输入框里输入信息时,根据你敲进去的字母,自动显示一个提示下列列表,很像百度或谷歌的搜索框的自动提示,在飞机票火车票的搜索页面上也有这样的效果.它是HTML5里新增的一个非常有用的元素. DataList的表现很像是一个Select下拉列表,但它只是提示作用,并不限制用户在input输入框里输入什么. HTML5 Datalist的语法其实跟select下拉列表的语法几乎完全一样,非常的简单! <label for="country_name"

input标签自动填充问题

<input type='text' placeholder='手机号' /> <input type='text' placeholder='地址' /> <input type="password" placeholder="密码"> ## 密码输入框 如上面的一些输入框, 在谷歌浏览器中,可能会对属性 type = 'password' 进行识别,并且会把 密码输入框 前面一个输入框当做 账号输入框 来自动填充: 当时在这两

input框自动填充内容背景颜色为黄色解决方法

谷歌浏览器input自动填充内容,背景色会是黄色,想改的话: input:-webkit-autofill { box-shadow: 0 0 0px 1000px white inset;} 这种方法没有了黄色背景,但是一点击input框还是会变为黄色 input:-webkit-autofill { box-shadow: 0 0 0px 1000px white inset !important;} 这种点击框也不会出现黄色了 还有一种就是关闭自动填充autocomplete="off&q

input密码自动填充

自动填充样式修改 input: -webkit - autofill, input: -webkit - autofill: hover, input: -webkit - autofill: focus, input: -webkit - autofill: active { -webkit - transition - delay: 99999s; -webkit - transition: color 99999s ease - out, background - color 99999s

chrome浏览器 input 禁止自动填充 autocomplete=&quot;off&quot; 无效

问题: <input  type="text" autocomplete="off"> 无效 <input  type="text" autocomplete="new-password"> 也无效 新版chrome浏览器还是有自动填充效果. 解决方法: 在form,和所有input 上面 添加 值不为 off 和 on 的autocomplete属性 如 <form autocomplete=&

input输入框自动获取焦点

代码实例: <html> <head></head> <body> 用户名:<input type="text" id="username" name="username" autofocus="autofocus"/><br/> 密码:<input type="text" id="password" name

基于jQuery的input输入框下拉提示层(自动邮箱后缀名)

基于jQuery的input输入框下拉提示层,方便用户输入邮箱时的提示信息,需要的朋友可以参考下 效果图 // JavaScript Document (function($){ $.fn.extend({ "changeTips":function(value){ value = $.extend({ divTip:"" },value) var $this = $(this); var indexLi = 0; //点击document隐藏下拉层 $(docum

chrome表单自动填充导致input文本框背景变成偏黄色问题解决

chrome表单自动填充导致input文本框背景变成偏黄色问题解决 作者:佚名 字体:[增加 减小] 来源:互联网 时间:08-21 18:43:32我要评论 chrome表单自动填充后,input文本框的背景会变成偏黄色的,想必大家都会碰到这种情况吧,这是由于chrome会默认给自动填充的input表单加上input:-webkit-autofill私有属性造成的,解决方法如下,感兴趣的朋友可以了解下 chrome表单自动填充后,input文本框的背景会变成偏黄色的,这是由于chrome会默认