jQuery Form Plugin issue with adding data to form.
I am trying to append additional form data with the jquery Form Plugin
i have this
- var uploadFrm = {
beforeSubmit: vUploadForm,
success: uploadResp, // post-submit callback
clearForm: true,
resetForm: false
and my vUploadForm function is this
- function vUploadForm(formData, jqForm, options){
var uploadcontrol = $("#fileField_"+_inspID).val().toLowerCase();
var pathArr = new Array();
var extRegEx = /(doc|docx|xls|xlsx|pdf)/
pathArr = uploadcontrol.split("\\");
extArr = pathArr[pathArr.length-1].split(".")
$("#file_upload_status_div").html("");
if (uploadcontrol.length > 0){
//Checks with the control value.
if(!extRegEx.test(extArr[extArr.length-1])){
$("#file_upload_status_div").html("Only doc, docx, xls, xlsx, pdf files are allowed!");
return false;
}
}
if($("#fileField_"+_inspID).val() == ""){
$("#file_upload_status_div").html("Please choose a file to upload.");
return false;
}
formData.push({ name: "unid", value: "<cfoutput>#form.unid#</cfoutput>" });
formData.push({ name: "qyr", value: _qtrYr });
formData.push({ name: "inspectionID", value: _inspID });
return;
}
if i run an alert on formData i see the value but they do not seem to get passed onto the page i am posting them to.
Any ideas what I am missing?
Thanks