单击我的提交按钮时,它会隐藏正常的提交按钮,并显示条纹模式按钮。点击此条纹模式按钮后,条纹付款窗口打开,允许用户输入付款信息。由于一些奇怪的原因,条纹模态窗口打开多次。此问题似乎只存在于Microsoft Edge上,因为它在Chrome上运行良好。
<div class="col-md-10" style="margin-top:12px;">
<div class="col-md-5" style="margin-left:40%;">
<input type="hidden" name="finddriver" value="1" />
<input type="submit" value="<?php _e
('Submit Job'); ?>" class="normalsubmit" />
<div class="loader"
style="display:none;"><p>Please wait payment button is loading...</div>
<div class="paymentbtn">
</div>
</div>
</div>
</div>
</form>
$(".form-control").on("change", function(){
var count=0;
$(".form-control").each(function(){
if($(this).val()){
count = count+1;
}
});
if(count >= 6){
var pay = parseFloat($("#jobpay").val());
payment = ("#jobpay")*100;
$(".normalsubmit").hide(); $(".loader").show();
$(".paymentbtn").html('<script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-
key="testkey" data-image="http://icadeliveries.com/wp-
content/uploads/2016/01/Logo-final-1-e1453881025544.png" data-
name="www.icadeliveries.com" data-label="Submit Job" data-
description="Payment for this job ($'+pay+'.00)" data-amount=
("'+payment+'" />'); $(".loader").hide();
}
else{
$(".normalsubmit").show();
$(".paymentbtn").html(""); $(".loader").hide();
}
});
});
</script>