0
I created an animation that appears on the screen and blocks the fields entered by the user while the request is processed, directly on submit
, as below:
onclick="javascript:document.getElementById('blanket').style.display = 'block';document.getElementById('aguarde').style.display = 'block'; block();"
Appearing the image below:
It turns out 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 runs anyway, and to go back to page only by updating the same.
Is there any way of onClick
await validation of the fields required
before performing this animation?
Thanks for the reply. I changed the function but it did not work, nor called animation.
– Diego
In place of
meu_form
goes the id of your form. I believe thatonlick
was on theinput
type Ubmit, right?! It will only fall into Ubmit if the required ones have been satisfied.– BrTkCa
Yes, I changed it with my form id, but it didn’t work. I’ll try again.
– Diego
Fine. If you can’t and you can raise a Fiddle, I’ll help you =]
– BrTkCa
It worked, I put it right into the form event and I took everything from Submit. + 1. Hug and thanks.
– Diego
I just found an "error". It triggers the animation only in the second click of Ubmit. If I fill everything correctly it does not trigger the animation, only if I click first "calling" the error, then after I fill everything it works. There’s something else I need to do?
– Diego
There is no @Diego, without seeing how your HTML is hard to say. Probably for some other reason your code must be generating this behavior.
– BrTkCa
The code is very large, I saved it here if you can take a look: http://200.208.251.153/InsereReserva.txt
– Diego
I’m sorry to ask, but you’ve seen the code?
– Diego