I have a simple contact form on my website that I'm hoping to send data with using AJAX/PHP.
When I hit the submit button, I get the error:
Uncaught TypeError: Cannot read property 'mode' of undefined
at Function.$.ajax (jquery.validate.js:1561)
at submitForm (form-scripts.js:21)
Line 21 begins below:
Code:
$.ajax({
type: "POST",
url: "php/form-process.php",
data: "name=" + name + "&email=" + email + "&message=" + message,
success : function(text){
if (text == "success"){
formSuccess();
} else {
formError();
submitMSG(false,text);
}
}
});
I am using jQuery 3.1.1 (https://code.jquery.com/jquery-3.1.1.slim.min.js) - perhaps this has something to do with it?
Any help would be greatly appreciated.