Hi, all.
I created a landing page with a form in Webflow.
The form is using POST method with getform.io
How do I disable the redirection to the Thank you page?
I could disable the Thank You page redirection using UseBasin form endpoint. But have no idea how to do it using getform.io
Below are the code used to disable UseBasin form endpoint while keeping Webflow form success and error message. I would need it to work with getform.io
<script type="text/javascript">
//apply only to forms with the action pointing to Basin
$('form[action^="https://usebasin.com"]').each(function(i,el){
form = $(el);
form.submit(function(e){
//stop the form from submitting
e.preventDefault();
form = $(e.target);
//get the form's action parameter and add ".json" to the end
action = form.attr('action') + '.json';
//submit the form via ajax
$.ajax({
url: action,
method: "POST",
data: form.serialize(),
dataType: "json",
success: function(data){
if(data.success){
//successful submission - hide the form and show the success message
parent = $(form.parent());
parent.children('form').css('display','none');
parent.children('.w-form-done').css('display','block');
} else {
//failed submission - log the output to the console and show the failure message
console.log(data);
parent.find('.w-form-fail').css('display','block');
}
},
error: function(){
//failed submission - show the failure message
parent.find('.w-form-fail').css('display','block');
}
});
});
});
</script>