I want to validate my form having
<input type="file" id="file[]">
I want to submit form only when file is uploaded else throw an error message popup.
The problem is this that i have made the code to upload the multiple files. So ID attribute of <input type="file"> is array(file[]).
I have tried
- document.getElementById('file').value
- document.getElementById('file[]').value
- document.getElementById('file[3]').value
But everytime it's not working. I have checked it via firebug, it is giving error
 document.getElementById(...) // is null.
 
     
     
     
     
    