-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenviar.js
45 lines (22 loc) · 1 KB
/
enviar.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var estadoBoton = false;
var boton = document.querySelector(".boton-enviarDeshabilitado");
function verificarEstado() {
if (nombreError.estado && asuntoError.estado && emailError.estado && mensajeError.estado) {
if ((boton.getAttribute("value") == "disabled") && estadoBoton == false) {
boton.classList.remove("boton-enviarDeshabilitado");
boton.classList.add("boton-enviar");
}
boton.setAttribute("value", "regular");
boton.removeAttribute("disabled");
estadoBoton = true;
}
if (estadoBoton && (nombreError.estado && asuntoError.estado && emailError.estado && mensajeError.estado) == false) {
if ((boton.getAttribute("value") == "regular") && estadoBoton) {
boton.classList.remove("boton-enviar");
boton.classList.add("boton-enviarDeshabilitado");
}
boton.setAttribute("value", "disabled");
boton.setAttribute("disabled", "");
estadoBoton = false;
}
}