EDIT: This is the error message i'm getting i dont know why its not working
As far as I know this should work as a locally opened html file, I have a html and php form and I want validation to validate the form to do as says in the code but it doesn't seem to be working, what would be easiest way to fix this?
I've basically just copied over the code over from another page I've done with some minor changed but cant see why its failing like it is, can anyone correct it or give some assistance?
HTML- Script:
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script> <script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
$(function() {
$("#Message").validate({
rules: {
Name: {
required: true,
minlength: 2,
maxlength: 15
},
Email: {
required: true,
email: true
},
Message: {
required: true,
minlength: 10
}
}});
});
</script>
Form:
<p><form id="Message" method="POST" action="message.php">
<p>Enter Name: <input id="Name" type="text" name="Name" size="20"></p>
<p>Enter Email: <input id="Email" type="text" name="Email" size="20"></p>
<p>Message: <input id="Message" type="text" name="Message" size"20"></p>
<p><input type="submit" value="Submit" name="Submit"></p>
PHP Message.php:
<?php
## CONFIG ##
# LIST EMAIL ADDRESS
$recipient = "MYEMAIL";
# SUBJECT (Subscribe/Remove)
$subject = "WebMsg";
# RESULT PAGE
$location = "received.html";
## FORM VALUES ##
$sender = $recipient;
# MAIL BODY
$body .= "Name: ".$_REQUEST['Name']."
";
$body .= "Email: ".$_REQUEST['Email']."
";
$body .= "Message: ".$REQUEST['Message']."
";
# add more fields here if required
## SEND MESSGAE ##
mail( $recipient, $subject, $body, "From: $sender" ) or header( "Location: $location" );
## SHOW RESULT PAGE ##
header( "Location: $location" );
?>
and finally the console error:
Uncaught TypeError: $(...).validate is not a function(anonymous function) @ index.html:15v.Callbacks.l @ jquery-1.8.3.min.js:2v.Callbacks.c.fireWith @ jquery-1.8.3.min.js:2v.extend.ready @ jquery-1.8.3.min.js:2A @ jquery-1.8.3.min.js:2
Thanks in advance for taking the time to read and anyone who can help!
++
This is the code that is making it error it says EDITED VVVV
Uncaught TypeError: $(...).validate is not a function(anonymous function) @ index.html:15m.Callbacks.j @ jquery-1.11.1.min.js:2m.Callbacks.k.fireWith @ jquery-1.11.1.min.js:2m.extend.ready @ jquery-1.11.1.min.js:2J @ jquery-1.11.1.min.js:2