close
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
全站熱搜