Hook into submit button

Hook into submit button

Hey there!

I am trying to call an action before submitting, when an order is placed in WooCommerce. I am trying to target the specific submit form like this:

  1. jQuery('form[name="checkout"]').submit(function(event) {
  2.   alert( "Checkout submit!" );
  3.   console.log('test');
  4.   event.preventDefault();
  5. });

However, it doesn't seem to work. The page just submits the order like it has always done.

Can someone please point me in the right direction?

Thanks!