Validaciones sin funcionar
Publicado por Mario Tovar (12 intervenciones) el 28/02/2018 21:24:34
tengo una funcion que valida si un select esta vacio asi evitar que el post envie valores vacios son 3 selects uno con id FECHA otro con id FECHA1 y el ultimo con id SUCUR segun la consola no hay errores en el java script pero no me funciona en el formulario tengo el atributo onsubmit="return nombrefuncion()"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function validacion(){
indice = document.getElementById("fecha").selectedIndex;
indice1 = document.getElementById("fecha1").selectedIndex;
indice2 = document.getElementById("sucur").selectedIndex;
if (indice == "")
{
alert("debe seleccionar un mes");
return false;
}
else if (indice1 == "")
{
alert("debe seleccionar año");
return false;
}
else if (indice2 == "")
{
alert("debe seleccionar una Sucursal")
return false;
}
}
});
Valora esta pregunta
0