Skip to content Skip to sidebar Skip to footer

Validate File Size And Type In A Multiple Input

i have 3 input file, i wanna make a javascript validation for 3 input file in one submit button form event onSubmit=''
Copy

and your click event handler should be,

$(document).ready(function(){
    $('#upload').click(function(){
        alert('hello');
        $('input[type="file"]').each(function(){
            var thisFile = $(this);
            var fileSize = thisFile[0].files[0].size;
            alert(fileSize);
        });
        $('form#dataPribadi').submit();
    });
});

UPDATED FIDDLE


Post a Comment for "Validate File Size And Type In A Multiple Input"