A
A
alex1nd2019-12-11 17:42:10
css
alex1nd, 2019-12-11 17:42:10

Wrong onsubmit fires How to onclick, how to change?

https://pravovoypomoshnik.ru/kontakti/
form

<form onsubmit="yaCounter54702787.reachGoal('zayavka'); return false;" id="form5" class="text-center" method="post" action="">

When you click send without data, the validation works fine, it does not skip. But it comes to the metric that the goal worked for submitting the form, and that the form is sent.
How to make onsubmit work normally, only when it is actually sent and not when the button is clicked simply.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alex1nd, 2019-12-12
@alex1nd

the problem turned out to be that there was still an onclick rule on the button, and it worked (on the modal call button itself. window)
and so the simple usual required works fine, the goal does not skip with empty data

M
Mr_Edward, 2019-12-11
@Mr_Edward

Use the flag that validation will return about the success / error of filling out the form.
Example: https://jsfiddle.net/Mr_Edward/fo9r1bga/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question