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