小智 4
我们遇到了这个问题。正如 Guy Thomas 提到的,这是因为表单中的密码字段带有抄送字段。
经过大量测试后,我确定在type提交表单之前可以将密码字段切换为不同的密码字段(在我们的例子中,只需切换为hidden)。这使得即使在对话框中选择“现在不”后也可以提交表单。
$("#submit").on("click", function(){
try{
$("input[type=password]").attr("type", "hidden");
} catch(ex){
try {
$("input[type=password]").prop("type", "hidden");
} catch(ex) {}
}
});
Run Code Online (Sandbox Code Playgroud)
我添加了 try/catchs,因为根据浏览器/jquery 版本,更改 type 属性会出错。
| 归档时间: |
|
| 查看次数: |
1730 次 |
| 最近记录: |