My Blog

Posts Tagged ‘multi input file’

Multiple File Upload plugin for jQuery and Cancel button

Thursday, November 20th, 2008

QuocKien here ask me to help him with Multiple File Upload plugin and cancel button

This the most easy way I think

it’s this simple js code (cancel button will work for second multi input file)

$(document).ready(function(){
        $(’.multi’).MultiFile();
        $(’.multi2′).MultiFile();
       

         $("#cancel_but").click(function() {
            $(".multi2").parent().find(’span a’).each(function() {
                $(this).click();
            });
        })

});

where is .multi2 - it’s selector of your multi file input

simple html

<input type="file" class="multi" />
<input type="file" class="multi2" /><input type="button" value="cancel" id="cancel_but" />

 

I hope this help