I have multiple file input controls which are dynamically generated through code. I tried to put sample script which is as below
<input type="file id="file1" />
<input type="file" id="file2" />
JS:
$(document).ready(function(){
$('input:file').on('change', function ()
{
for (var i = 0; i < this.files.length; i++)
{
alert(this.files[i].name);
}
});
});
I think my code is in getting the files is wrong.