in case of input type file the value is stored in array as files with key name.

$('input#my_id').change(function(){var files = $(this)[0].files;if(files.length >10){
        alert("you can select max 10 files.");}else{
        alert("correct, you have selected less than 10 files");}});

fiddle example : http://jsfiddle.net/nze2B/3/

 

 

http://stackoverflow.com/questions/9232633/how-to-count-selected-files

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 amychang2014 的頭像
    amychang2014

    工作需要筆記

    amychang2014 發表在 痞客邦 留言(0) 人氣()