Viewing 1 replies (of 1 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hey Marco,

    You can do that using the following piece of JS code.

    <script>
     (function() {
        var form = document.querySelector('.mc4wp-form form');
        if( ! form ) { return; }
        form.onsubmit = function() {
             // do something
         }
     })();
    </script>

    This code can be added to the bottom of your form mark-up but maybe a better place would be the footer of your theme.

    Hope that helps. If not, let me know!

    PS. Should you have a quick minute to spare, a plugin review here on WordPress.org would make us quite happy. 🙂

Viewing 1 replies (of 1 total)

The topic ‘Insert onsubmit event in the form’ is closed to new replies.