This code below works for a single file.
Code: Select all
<script>
function valid_form() {
var temp = document.sc_files.sd_file.value;
if (temp.length > 0) {
if (temp.indexOf(".pdf") == -1) {
alert("Support docs must be PDF files.");
return false;
}
}
return true;
}Code: Select all
<tr><td><input type=file size=40 name=sd_filesї]></td></tr>
<tr><td><input type=file size=40 name=sd_filesї]></td></tr>This works just fine for uploading the files. But I want to modify my JS validation to work with the multiple files. When I try to reference in JS:
Code: Select all
var temp = document.sc_files.sd_filesї0].value;