0
I’m having trouble validating the files of a input
of the kind file
which has an array and is also a multiple
. As in the function below the variable appointing just give me back the name of the first file and there are other 3 or may even be more. Someone has already gone through this?
function envia(){
var nomearquivo = document.getElementById('file').value;
var valor = nomearquivo.split("-");
var data = valor[0].slice(-8);
var n = data.split("");
var databr = n[0]+n[1]+'/'+n[2]+n[3]+'/'+n[4]+n[5]+n[6]+n[7];
var valida = valida_data_novo(databr);
if(valida){
document.forms[0].submit();
}
}
<INPUT TYPE="FILE" NAME="arquivo[]" ID="file" multiple/>