我正在使用jQuery文件上传,并且在成功时我试图将隐藏的输入字段附加到表单但它不起作用,该元素未被附加。
jupload.fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '/content/upload',
done: function (e, data) {
$("#fileupload").append('<input type="hidden" name="uploaded_files[]">');
}
});
HTML:
<form action="create-submit" id="fileupload" method="POST" enctype="multipart/form-data">
...
</form>