I have a strange problem. I added the function below to prevent the user from clicking more than once on the submit. But from the moment I added it, HTML5 required and validate () stopped working in all fields. Could anyone tell me the reason?
function block() {
var button = document.getElementById("confirmar");
button.removeAttribute("disabled");
button.onclick = function() {
if (!button.getAttribute("disabled") != "disabled") {
button.setAttribute("disabled", "disabled");
setTimeout(function() {
button.removeAttribute("disabled");
}, 5000);
document.getElementById("cadastro").submit();
}
}
}
<body class="noheader" onload="moveRelogio(); getInfo(); document.cadastro.reset(); slide(); block()">