Required Fields Not Enforced, Redirect to Success Occurs
-
Hello,
We’re tracking form submissions by redirecting to a success page, after an event listener is triggered targeting each specific form.
The issue we’re having is that if you load the page, don’t fill any fields out, hit submit… you get the error message, but then the redirect executes anyways.
So it seems that it is either a bug or lack of functionality missing in the event listener.
Here is my code:
<script> // Redirect forms to success page. document.addEventListener( 'wpcf7submit', function( event ) { if ( '349' == event.detail.contactFormId ) { location = 'https://domain.com/consultation-success/'; // Consultation Form } if ( '7' == event.detail.contactFormId ) { location = 'https://domain.com/contact-success/'; // Contact Form } }, false ); </script>
Thanks for the assistance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Required Fields Not Enforced, Redirect to Success Occurs’ is closed to new replies.