.submit () 不包括隐藏字段

.submit () isn't including hidden fields

将 jQuery .submit() post 绑定到 dropzone file upload 完整处理程序会导致发送所有正确的数据,但它缺少隐藏的输入字段。代码全部是phpjquery/js

无法找到关于为什么将这些排除在外的任何信息。

所有隐藏字段都在表单中,并且填写了name和id

<pre>
<code>
<form id="payments" method="post" action="<?php $_SERVER['PHP_SELF'] ?>" class="form-horizontal" >

<input type="hidden" name="transID" value="<? if(isset($values['transID'])){echo $values['transID'];}else{ echo $transID; } ?>" />
<input type="hidden" name="transID" value="<? if(isset($values['transID'])){echo $values['transID'];}else{ echo $transID; } ?>" />
<input type="hidden" id="pdflink" name="pdflink" value="<? if(isset($values['pdflink'])){echo $values['pdflink'];} ?>" />
<input type="button" name="btnSubmit" value="Submit PDF & Payment(s)" onclick="this.disabled" id="btnSubmit" class="col-md-6 btn btn-primary raised" />
</form>
<script>
$('#upload').fileupload({

// This element will accept file drag/drop uploading
autoUpload: true,
dropZone: $('#drop'),
limitMultiFileUploads:1,
maxNumberOfFiles: 1,
fileInput: $('#upl'),
url: 'acctfilesupload',
dataType: 'text',

// This function is called when a file is added to the queue;
// either via the browse button, or via drag/drop:
add: function (e, data) {

var tpl = $('<li class="working"><p></p></li>');

// Append the file name and file size
tpl.find('p').text("Submitted File: " + data.files[0].name).append('  <i>' + formatFileSize(data.files[0].size) + '</i>');

// Add the HTML to the UL element
data.context = $(ul).html(tpl);


// upload the file once it is added to the queue
$('#btnSubmit').click(function(){
var jqXHR = data.submit();})
},

progressall: function (e, data) {
var progress = parseInt(((data.loaded / data.total * 85)+ 15), 10);
$('#uploadprogress').css('width', progress + '%').html("&nbsp;&nbsp;Uploaded: " + progress + '%');
    },
done: function(e, data){
var r = data.result;
if (r.lastIndexOf("\\FShost\Accounts", 0) === 0) {
$('#pdflink').val(r);
$('#payments').submit();
} else {
alert(r);
$('#btnSubmit').prop('disabled',false);
$('#uploadprogress').css('width','15%').html("&nbsp;&nbsp;Uploaded: 0%");
}
}
}).bind('fileuploadsubmit', function (e, data) {
data.formData = {
name: $('#uploadname').val(),
memberid: $('#memberidupload').val(),
transid: $('#acctfilesubID').val(),
amount: $('#AmountOwed').val()
};
});

</script>
</code>
</pre>

找到了!问题是可以以一种形式提交的最大字段数 php 的硬性限制。恰好最后一个要提交的字段也恰好是隐藏字段出现在 POST

之前的最后一个字段