0
我试图使用ajax请求提交输入字段并上传文件。每件事情都很好。除了隐藏的输入值不发送$(#job)。隐藏的输入未使用jquery提交
$.ajaxFileUpload({
url :'careers-training/apply-job/',
secureuri :false,
fileElementId :'cv',
dataType : 'script',
data :{'job' : $('#job').val(),'name' : $('#name').val(),'email' : $('#email').val(),'mobile' : $('#mobile').val(),'cv' : $('#cv').val()},
success : function (Response, status)
{
var jsonObject = $.parseJSON(Response);
if(jsonObject.length == 0)
{
$(this).HideLoadingPanel();
$(this).ShowSuccessPanel();
$("#job-application-box").hide();
$("#body").attr('style','min-height:400px;')
}else{
$(this).HideLoadingPanel();
$(this).ShowErrorsBox(jsonObject);
}
}
});
,这是HTML:
<form name="apply-job-form" method="post" enctype="multipart/form-data">
<input name="job" id="job" type="hidden" value="dd" />
<label class="form-label">Name: </label>
<input class="form-input" type="text" id="name" name="name" /><br />
<label class="form-label">Mobile: </label>
<input class="form-input" type="text" id="mobile" name="mobile" /><br />
<label class="form-label">Email: </label>
<input class="form-input" type="text" id="email" name="email" /><br />
<label class="form-label">CV: </label>
<input class="file-input" type="file" id="cv" name="cv" />
<button type="button" id="apply-job-button" name="apply-job-button" class="form-button">Apply now !</button>
</form>
所以你能帮助我吗?
请提供您的HTML。 – RedFilter
HTML请???检查你是否有隐藏的输入与id作业 –
Html张贴... – Hatem