在iOS7上停止Safari,提示保存卡片数据 [英] Stop Safari on iOS7 prompting to save card data

查看:142
本文介绍了在iOS7上停止Safari,提示保存卡片数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户的网站,它提示他们在iOS7下保存卡片的详细信息。我完全没有发现任何事情导致iOS决定这是正确的做法 - 有没有人有任何想法?

解决方案

确切的问题。正如盖伊托马斯提到的,这是由于密码字段的形式与CC字段。



经过大量测试,我确定密码字段可以切换到在提交表单前(在我们的例子中,只是切换到隐藏),一个不同的类型。这允许表单提交,即使在对话框中选择不是现在。

  $(#submit)。on (click,function(){
try {
$(input [type = password])。attr(type,hidden);
} catch ){
try {
$(input [type = password])。prop(type,hidden);
} catch(ex){}
}
});

我添加了try / catch,因为取决于browser / jquery版本,更改type属性会出错。

I have a client's site which is prompting them to save card details under iOS7. I can find absolutely nothing regarding how or what is causing iOS to decide this is the right thing to do - does anyone have any ideas?

解决方案

We were running into this exact issue. As Guy Thomas mentioned, it was due to having password fields in the form with the CC fields.

After lots of testing, I determined that the password fields could be switched to a different type before submitting the form (in our case, just switched to hidden). This allowed the form to submit even after choosing "Not Now" in the dialog.

$("#submit").on("click", function(){
    try{
        $("input[type=password]").attr("type", "hidden");
    } catch(ex){
        try {
            $("input[type=password]").prop("type", "hidden");
        } catch(ex) {}
    }          
});

I added the try/catches because depending on browser/jquery version, changing the type attribute would error.

这篇关于在iOS7上停止Safari,提示保存卡片数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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