当用户点击esc警报时,不应该关闭他应该点击立即付款按钮进一步移动。
if($unpaid==true){
echo $print = '<script>
function alertOn(){
swal({
title: "No Membership Fees Received",
text: "Please pay membership fees as per your selected package",
type: "warning",
confirmButtonText: "PAY NOW"
},
function(){
window.location.href = "unpaid.php";
});
};
window.onload = alertOn
</script>';
答案 0 :(得分:1)
if ($unpaid == true) {
echo $print1 = '<script>
function alertOn(){
swal({
title: "No Membership Fees Received",
text: "Please pay membership fees as per your selected package",
type: "warning",
confirmButtonText: "PAY NOW",
**allowEscapeKey:false**
},
function(){
window.location.href = "unpaid.php";
});
};
window.onload = alertOn;
</script>';
}
答案 1 :(得分:0)
我认为您可以使用此版本:
swal({
title: 'title',
text: 'your text',
button: false,
closeOnClickOutside: false,
closeOnEsc: false
});
答案 2 :(得分:-1)
是的,您可以通过将swal
和allowEscapeKey
属性修改为allowOutsideClick
来配置false
函数,例如:
swal({
title: 'title',
text: 'your text',
showConfirmButton: true,
allowEscapeKey : false,
allowOutsideClick: false
});