After being annoyed that webflow doesn't allow custom or blank form actions out of the box (big no-no) and after some investigating, I came up with the following code to cancel the default webflow form handling and replace it by your own:
Paste this in Site Settings > Custom Code > Footer Code to affect the entire site, or Page Settings > Footer Code for forms in that page only.
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
// === Custom Form Handling ===
// unbind webflow form handling
$(document).off('submit');
// new form handling
$('form').submit(function(evt) {
evt.preventDefault();
alert("Your custom action here");
});
});
</script>
Pro Tips:
You can use Chrome's "event listener" tab in the developer menu to look for functions bound to your DOM
You can also use this trick from stack to print all attached functions of a DOM element to the console as a nested object:
var elem = $('#someid')[0];
var data = jQuery.hasData( elem ) && jQuery._data( elem );
console.log(data.events);
A word to @webflow & @cyberdave :
We love how easy you make it to build quick prototypes and websites, and also how easy you make more complex things for new users like form submission ... BUT please don't silo in your users and allow more advanced web developers (who are already on a paying plan) to access functions when needed out of the box (like custom form actions ! - really there are countless questions on the forum about this topic).
Thank you & keep up the good work !