Skip to content Skip to sidebar Skip to footer

Use Submit Event Listener When Form Is Submitted Via Inline Javascript?

We have a script that tracks form submits by adding an event listener to the form. The problem is that one customer submits the form via a link using ); form[0].addEventListener("submit", function(e) { e.preventDefault(); alert('event'); }); form[0].childNodes[3].addEventListener("click", function(e) { e.preventDefault(); alert('event'); });

Solution 2:

Solution 3:

try the following with jquery:

$("form").submit(function (e) {
      e.preventDefault();

      alert('event');
});

Reference here.

Post a Comment for "Use Submit Event Listener When Form Is Submitted Via Inline Javascript?"