【发布时间】:2013-06-06 11:30:19
【问题描述】:
如何将此值添加到输入名称值以打印值作为输入以帮助我处理表单
$('<textarea/>').text(file.name).appendTo('#files');
我需要得到我们的 as
谁能帮我解决这个问题
完整代码
<script>
/*jslint unparam: true */
/*global window, $ */
$(function () {
'use strict';
// Change this to the location of your server-side upload handler:
var url = (window.location.hostname === 'server/php/' ||
window.location.hostname === 'server/php/') ?
'//jquery-file-upload.appspot.com/' : 'server/php/';
$('#fileupload').fileupload({
url: url,
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<textarea/>').text(file.name).appendTo('#files');
});
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .bar').css(
'width',
progress + '%'
);
}
});
});
</script>
【问题讨论】:
-
我尝试了但是当我设置输入和文本区域但我需要值作为