Input type file validation as id attribute is array instead of single value

mortho7

New Member
I want to validate my form having \[code\]<input type="file" id="file[]">\[/code\]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 \[code\]<input type="file">\[/code\] is \[code\]array(file[])\[/code\].I have tried [*]\[code\]document.getElementById('file').value\[/code\][*]\[code\]document.getElementById('file[]').value\[/code\][*]\[code\]document.getElementById('file[3]').value\[/code\]But everytime it's not working. I have checked it via firebug, it is giving error \[code\] document.getElementById(...) // is null.\[/code\]
 
Back
Top