/thank-you-page-url with your custom URL.To display a custom thank you page for a sign-up form and bypass the Webflow default success or failure state, you can use jQuery to listen for the form submission event and perform a redirect.
$(document).ready(function() {
$('form').submit(function(e) {
e.preventDefault(); // **Prevent the default form submission**
var form = $(this);
$.ajax({
type: 'POST',
url: form.attr('action'), // Use the form's action URL
data: form.serialize(), // Serialize the form data
success: function() {
// **Redirect to the custom thank you page**
window.location.href = '/thank-you-page-url';
},
error: function() {
// **You can handle errors here if required**
}
});
});
});
/thank-you-page-url with the actual path of your custom thank you page.
To disable the Webflow default success or failure state for a form, use jQuery to submit the form via AJAX and redirect users to a custom thank you page upon successful completion. This approach allows for a seamless user experience by bypassing the built-in form message updates.