I have a customer registration form that runs the submit button on the register button:
document.getElementById("formularioCadastro").submit();
All ok, the registration works, but I wanted to return a BOOLEAN true or false, to see if it was successfully registered or made an error.
I tried the following code:
var sucess = document.getElementById("formularioCadastro").submit();
if(sucess == true){
alert("cadastrado com sucesso!");
else{
alert("erro ao cadastrar cliente");
}
}
But it did not work, can anyone help me?