Documentation

Talk:Tutorials:Multiple File Upload Magic

From jQuery JavaScript Library

Jump to: navigation, search

Some recomendaition! You need change the function this way:

function doIt(obj, fm) { if($('input.upload').size() > fm) {alert('Max files is '+fm); obj.value=;return true;} $(obj).hide();

$(obj).parent().prepend('<input type="file" class="upload" name="fileX[]" />').find("input:first").change(function(){doIt(this, fm);}); var v = obj.value; if(v != ) {

$("div#files_list").append('
'+v+'<input type="button" class="remove" value="Delete" />
')

.find("input").click(function(){ $(this).parent().remove(); $(obj).remove(); return true; }); }

};