有没有办法选择特定的形式进行序列化?我的 CF 页面上有多个表格。我想选择一个特定的表单,提交 ajax 帖子,然后选择第二个表单并提交一个 ajax 帖子。
$('.CSubmitSurvey').live('click', function(e) {
var strCandidateSurveyForm = $('#sendSurveysCandidate').serialize();
alert (strCandidateSurveyForm);
IndividualNumber = document.getElementById('sendSatTo2').value;
companyNumber = document.getElementById('companyID').value;
surveyNumber = document.getElementById('surveyID').value;
resendSurvey = document.getElementById('ReSendYN').value;
RefID = document.getElementById('RefID').value;
ClientCandidate = document.getElementById('ClientCandidate').value;
EmailOverride = document.getElementById('EmailOverride').value;
SendSatEmail = $('input:radio[name=SendSatEmail]:checked').val()
//alert(SendSatEmail);
$.ajax({
type: "POST",
url: 'actSendSurveys.cfm',
data: '<cfoutput>indivNum=' + IndividualNumber + '&board_type=#board_type#&jobid=' + jobid + '&companyid=' + companyNumber + '&resendyn=' + resendSurvey + '&SurveyNumber=' + surveyNumber + '&RefID=' + RefID + '&ClientCandidate=' + ClientCandidate + '&SendSatEmail=' + SendSatEmail + '&EmailOverride=' + EmailOverride</cfoutput>,
error: function(xhr, textStatus, errorThrown) {
// show error
alert(errorThrown);
},
success: function(response1, textStatus, jqXHR) {
//alert('success');
if (ClientCandidate == 'client'){
ColdFusion.Grid.refresh('ClientSurveyGrid',true);
}
else {
ColdFusion.Grid.refresh('CandSurveyGrid',true);
}
}
});
});