I have a Form that validates a submit in wordpress. The following code is in a Wordpress Template and I want the event Listener Submit not to run, how can I prevent it from running? To explain myself better, when you click on the button type submit, the form does not send anything, it does not perform the submit process.
This is the link where the form is: link
n.on("submit", function (t) {
if (t.preventDefault(), !0 === a.form_submitting) return !1;
a.form_submitting = !0;
var i = e(this),
n = i.find(".zn_contact_ajax_response:eq(0)"),
o = !1,
s = {
fields: i.find('textarea, select, input[type="text"], input[type="checkbox"], input[type="hidden"]')
},
r = n.attr("id"),
l = i.find(".zn_contact_submit");
if ((f || u || p) && i.is('[action="#"]') && i.attr("action", ""), l.addClass("zn_form_loading"), s.fields.each(function () {
var t = e(this),
a = t.parent();
t.is(":checkbox") && (t.is(":checked") ? t.val(!0) : t.val("")), a.removeClass("zn_field_not_valid"), t.hasClass("zn_validate_not_empty") ? t.is(":checkbox") ? t.is(":checked") || (a.addClass("zn_field_not_valid"), o = !0) : "" === t.val() && (a.addClass("zn_field_not_valid"), o = !0) : t.hasClass("zn_validate_is_email") ? t.val().match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/) || (a.addClass("zn_field_not_valid"), o = !0) : t.hasClass("zn_validate_is_letters_ws") ? t.val().match(/[^A-Za-z\s]/i) && (a.addClass("zn_field_not_valid"), o = !0) : t.hasClass("zn_validate_is_numeric") && isNaN(t.val()) && (a.addClass("zn_field_not_valid"), o = !0)
}), o) return l.removeClass("zn_form_loading"), a.form_submitting = !1, !1;
var d = i.serialize();
return e.post(i.attr("action"), d).success(function (t) {
a.form_submitting = !1, l.removeClass("zn_form_loading");
var n = e(t).find("#" + r + " > .zn_cf_response"),
o = e("#" + r),
d = i.data("redirect");
o.html(n), n.hasClass("alert-success") && (s.fields.val(""), d && window.location.replace(d))
}).error(function () {
console.log("Error loading page")
}), !1
})