Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/09/2015, 13:21
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: numero de imagenes en un input tipo file

quizás no he entendido bien lo que pretendes, arreglo a la respuesta de @Alexis88, pero si es tal y como yo lo entiendo es fácil controlar el número de archivos que se pueden subir a la vez

Cita:
function contarImgs() {

document.getElementById('arch').addEventListener(' change', function() {

if (this.files.length >= this.getAttribute('maxImg')) {alert('demasiados archivos'); this.value = '';}
});
}

window.onload = contarImgs;

<input type="file" id="arch" size="20" multiple maxImg="8" />
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}