我有一个简单的 jquery 脚本,它在单击按钮后调用花式框,现在的问题是,花式框在第一次单击按钮后不会关闭,只有在第二次单击后...
第二个问题是,在花哨的框中,有一个带有 3 个输入字段的表单,提交按钮/按钮无法单击一次,它还需要单击两次..有什么想法吗?
jQuery("#hsbcloanbutton").click(function(e){
e.preventDefault();
var loanAmount = jQuery('#loanAmount').val();
var loanTenure = jQuery('#loanTenure').val();
var InstalmentAmount = jQuery('#InstalmentAmount').val();
var loanName = jQuery('#loanName').val();
var loanNric = jQuery('#loanNric').val();
var loanContact = jQuery('#loanContact').val();
if(loanAmount.length < 1 || loanTenure.length < 1 || InstalmentAmount.length < 1)
{
alert("Please enter data");
return false;
} else if(isNaN(loanAmount) || isNaN(InstalmentAmount)){
alert("Please put numbers only in Loan Amount and Instalment Amount fields");
return false;
} else {
jQuery("#hsbcloanbutton").fancybox({
'titlePosition' : 'inside',
'transitionIn' : 'none',
'transitionOut' : 'none',
'hideOnOverlayClick' : false,
'hideOnContentClick' : false,
'showCloseButton' : false,
});
}
jQuery("#hsbcloansubmitformbutton").click(function(e){
e.preventDefault();
jQuery.ajax({
'type' : 'POST',
'url' : "<?php echo Yii::app()->createUrl?>",
)};
});
});