• 
    <script>
    
    document.addEventListener( 'wpcf7submit', function( event ) {
      const mydiv = document.querySelector('#cf-99917');
      var invalid = mydiv.classList.contains('invalid'); 
      var payment_type = document.getElementById("payment-type").value;
      if(!invalid) {
        if (payment_type.indexOf("Paypal") !== -1) {
          event.preventDefault(); 
          document.getElementById("cf-99917").action = "https://wooc.nanps.org/wp-content/themes/natural-child/pp-membership-payments.php"; 
        }
        document.getElementById("cf-99917").submit();
      }
    }, false );
    
    
    </script>

    Using the above code to redirect. Looking to add a skip_mail to this if payment type is Paypal. Any suggestions would be appreciated? Thanks

    • This topic was modified 2 years, 10 months ago by arconsulting.

    The page I need help with: [log in to see the link]

The topic ‘javascript onsubmit plus skip mail’ is closed to new replies.