After having spent hours trying to solve a seemingly simple problem (being walking through stackoverflow questions...), here I am once more obliged to turn to stackoverflow and submit my issue...I have a very basic form just two controls: a text input and a submit bottom. I am trying to get the jquery validation plugin to work. Here is my code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" ></script>
<script src="jquery.validate.js"></script>
<script>
$(function () {
$('#frm').validate({
rules: {
txtInput: {
required:"Reuired"
}
},
messages:{
txtInput:"Please enter your first name"
}
});
});
</script>
</head>
<body>
<form id="frm" name="frm" method="post">
<div>
<input id="txtInput" type="text" placeholder="Name" />
</div>
<br />
<input id="btn" type="submit" class="btn btn-danger" value="Submit" />
</form>
</body>
</html>
jquery.validate.js is version 1.11.1
My understanding is that if i submit the form with blank text input I must receive the message "Please enter your first name". But nothing happens and the form submits normally. I cannot figure out what I am doing wrong. The case is fairly simple. Thank you in advance for whatever help and/or direction you may give me.