If you want to redirect users to a custom thank you page instead of using the default Webflow success or failure messages, here's how to achieve that using jQuery.
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-KyZXEAg3QhqLMpG8r+Knujsl5/fw94rYM8UmcFrBg/Q=" crossorigin="anonymous"></script>.
```plaintext
<script>
$(document).ready(function() {
$('form').submit(function(event) {
event.preventDefault(); // Prevents the default form submission
var form = $(this); // Current form
$.ajax({
type: 'POST',
url: form.attr('action'),
data: form.serialize(),
success: function(response) {
// Redirect on success
window.location.href = 'https://www.your-custom-thank-you-page.com';
},
error: function(xhr, status, error) {
// Log or alert error if needed
console.error('Form submission error:', error);
}
});
});
});
</script>
```
To bypass Webflow's default form submission success or failure messages, use a jQuery script to intercept the form's submit action. Redirect users to a custom thank you page by handling the submission via AJAX and overriding default behaviors.