0
I’m having a strange problem. I added the function below to prevent the user from clicking more than once on Submit. But from the moment I added her, the required HTML5 and validate() stopped working in all fields. Someone would know why?
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()">
why don’t you put a Hide() on the Ubmit button next to the event click()?
– SneepS NinjA
in your case I think so
document.getElementById('confirmar').style.display = 'none';
if Submit is that element confirm– SneepS NinjA
of course within the event . onclick() there you have posted
– SneepS NinjA
I tried to change but it didn’t work, the button disappeared and it didn’t appear anymore...
– Diego
Disappeared and the form was sent anyway
– Diego
[...prevent the user from clicking more than once on Ubmit.. ] one click and then Hide, if the whole form is gone then that id='confirm' is the form id and not the input-Ubmit look there
– SneepS NinjA