how to add this value to input name value to print values as input to help me with forms
$('<textarea/>').text(file.name).appendTo('#files');
< input type='text' name='photo[]' value=''/>
i need to get our as < input type='text' name='photo[]' value='file.jpg'/>
can any one help me with it that
full code
<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>