We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b74a5c commit b64fa5eCopy full SHA for b64fa5e
1 file changed
assets/scripts/wplf-form.js
@@ -5,6 +5,7 @@
5
window.wplf = {
6
successCallbacks: [],
7
errorCallbacks: [],
8
+ beforeSendCallbacks: [],
9
submitHandler: function (e) {
10
var form = e.target;
11
var data = new FormData(form);
@@ -25,6 +26,10 @@ window.wplf = {
25
26
// reset errors
27
error.parentNode.removeChild(error);
28
});
29
+
30
+ window.wplf.beforeSendCallbacks.forEach(function(func) {
31
+ func(form);
32
+ });
33
34
fetch(ajax_object.ajax_url, {
35
method: "POST",
0 commit comments