I created an animation that appears on the screen and blocks the fields entered by the user while the request is processed, directly in submit
, as below:
onclick="javascript:document.getElementById('blanket').style.display = 'block';document.getElementById('aguarde').style.display = 'block'; block();"
The image below appears:
It happens that if the user does not fill in some information, the form is not sent and the warning appears due to the required , but the animation is executed anyway, and to return the page only updating the it.
Is there any way to onClick
wait for validation of required
fields before running this animation?