As i'm very new to jQuery i'm having trouble validating my very first as well as very simple login form using jQuery validation.
I have searched for jQuery validation and have also seen many questions posted on the site but found them helpless for myself.
Here is my code.
Please help me finding out my mistake.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>apply.html</title>
<script type="text/javascript" src="jquery-1.11.1.js"></script>
<script type="text/javascript" src="jquery.validate.js"></script>
</head>
<body>
<script type="text/javascript">
$("#testForm").validate({
rules: {
uname: { required: true },
pwd: { required: true }
},
messages: {
uname: { required: "Username can not be left blank" },
pwd: { required: "Please enter Password" }
}
});
</script>
<form action="#" method="POST" id="testForm">
Username :
<input type="text" name="uname" /><br>
Password :
<input type="password" name="pwd" /><br>
<input type="submit" value="Push">
</form>
</body>
</html>
EDIT : the problem i'm facing is that on submitting the form no error message message is showing i.e. no validation taking place.