autocomplete = off在chrome中不工作 [英] autocomplete= off not working in chrome

查看:375
本文介绍了autocomplete = off在chrome中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们有两个文本框,其中一个用于信用卡号,第二个用于存款验证码和它的类型=密码。

现在问题是当页面加载在谷歌浏览器它发现类型=密码它加载保存电子邮件ID在Credit Card Textbox and password in Verification Code。



现在尝试解决这个问题,我尝试了下面的内容。

 < form autocomplete =off> 

< asp:textbox autocomplete =off>

上面这个尝试对我来说并不合适。

解决方案

Chrome浏览器现在忽略了autocomplete =off,除非它自v34开始,位于< form autocomplete =off> 标签中。



通过创建一个隐藏的输入作弊。自动完成功能将获得第一个输入文本来填充数据。



方法1:

 < form id =method =postaction =autocomplete =off> 
< input type =textstyle =display:none/>
< input type =passwordstyle =display:none>
< asp:textbox autocomplete =off>
< / form>

因此,请将其放在文本框之前。

 < input type =textstyle =display:none/> 

方法2:

更改

  autocomplete =off

  autocomplete =false
以只读模式进行浏览器自动填充。 $ b
$ b

 < input type =passwordreadonly onfocus =this.removeAttribute('readonly');/> 

方法4:

用于用户名密码组合。 Chrome启发式查找模式。

 < input type =textonfocus =this.type ='password' > 

方法5:
jQuery

  if($ .browser.webkit){
$('input [name =password]')。attr('autocomplete' ,'off');
$('input [name =email]')。attr('autocomplete','off');
}


We are working on one web application in that one payment page is there.

In that we have two Text box one is for Credit Card Number and second one is for Verification Code and it type="Password".

Now problem is when page is load in google-chrome it found type="Password" it load Save email id in Credit Card Textbox and password in Verification Code.

Now try to solve this issue i was try out something like below.

<form autocomplete="off">

<asp:textbox autocomplete="off">

This above try is not work for me. i was googling it but by luck it's not work for me.

解决方案

It appears that Chrome now ignores autocomplete="off" unless it is on the <form autocomplete="off"> tag since v34.

you can't cheat by create an hidden input over. Auto complete feature will get the first input text to fill data.

Method 1:

<form id="" method="post" action="" autocomplete="off">
    <input type="text" style="display:none" />
    <input type="password" style="display:none">
    <asp:textbox autocomplete="off">
</form>

So put this before your textbox.

<input type="text" style="display:none" />

Method 2:

Change

autocomplete="off" 

to

autocomplete="false" 

Method 3: Browser autofill in by readonly-mode.

 <input type="password" readonly onfocus="this.removeAttribute('readonly');"/>

Method 4:

For username password combinations. Chrome heuristics looks for the pattern.

<input type="text" onfocus="this.type='password'">

Method 5: jQuery

if ($.browser.webkit) {
    $('input[name="password"]').attr('autocomplete', 'off');
    $('input[name="email"]').attr('autocomplete', 'off');
}

这篇关于autocomplete = off在chrome中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆