Contact form and ajax

I created a contact form that uses ajax to connect to my script on the server. When the response comes from the script, I can’t get the code to manipulate the response.
Any help will be greatly appreciated.

view site

.on("success.form.fv", function(e) {
      // Prevent form submission

      let $form = $(,
        fv = $"formValidation");

      // Use Ajax to submit form data
        url: $form.attr("action"),
        type: "POST",
        data: $form.serialize(),
        success: function(result) {
          // ... Process the result ...
          if (result === "success") {
          } else {
            submitMSG(false, result);

const formSuccess = () => {
    submitMSG(true, "Thanks! Your Message Has Been Sent.");

  const submitMSG = (valid, msg) => {
    if (valid) {
      var msgClasses = "alert alert-success text-center";
    } else {
      var msgClasses = "alert alert-danger text-center";

the formSuccess() function does not run when I get a response of ‘success’.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.