Answer the question
In order to leave comments, you need to log in
Why does the metric target fire on click?
What's the point of setting the onsubmit target in this way if it will still work on a normal submit click (even if the form is not submitted)?
ps I tried to insert console.log into onsubmit for the first option to insert a metric, which worked every time with a normal click
<html>
...
<form action="" method="get" onsubmit="yaCounterXXXXXX.reachGoal('ORDER'); return true;">
...
</form>
...
</html>
<html>
...
<form action="">
...
<input type="button" onclick="yaCounterXXXXXX.reachGoal('ORDER'); return true;" value="Заказать" />
</form>
...
</html>
Answer the question
In order to leave comments, you need to log in
on a normal submit click (even if the form is not submitted)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question