我在更改下拉选项时提交表单。提交表单后我重定向到同一页面。我使用以下功能提交表单:
function submitform(){
//Below variables are checkbox value
var addresscheck = $('#addressmatchedCheck').is(':checked');
var rcnumbercheck = $('#rcnumbermatched').is(':checked');
var phonenumbercheck = $('#phonenumbercheck').is(':checked');
var idproofcheck = $('#idproofcheck').is(':checked');
var guarantoraddresscheck = $('#guarantoraddressmatchedCheck').is(':checked');
var guarantoridcheck = $('#guarantoridproofcheck').is(':checked');
var guarantorrelationcheck = $('#guarantorrelationshipCheck').is(':checked');
if( addresscheck & rcnumbercheck & phonenumbercheck & idproofcheck & guarantoraddresscheck & guarantoridcheck & guarantorrelationcheck) {
$('#statusid').val(1);
alert($('#statusid').val() + "if");
}
else{
$('#statusid').val(2);
alert($('#statusid').val() + "else");
}
$('#fieldVerificationFormID').attr('method', 'POST');
$('#fieldVerificationFormID').attr('action', '/mfi/api/1.0/client/ci/groups/member/fieldverification/insert');
$('#fieldVerificationFormID').submit();
}
我的问题是复选框即使被选中也只返回错误?第一次,即在表单提交之前它完全正常。问题是在表单提交之后。谁能解决我的问题?