Can anyone please tell me why this method doesn’t work here .(‘ alphanumeric:true’) Here is my code
$(document).ready(function () {
$('#myform').validate({ // initialize the plugin
rules: {
fname: {
required: true,
alphanumeric:true, //I’m not sure about this if this is wrong please tell me
},
},
messages: {
fname: "Please enter your first name",
},
submitHandler: function (form) { // for demo
alert('valid form submitted'); // for demo
return false; // for demo
}
});
});
HTML
<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jQuery.validate.min.js"></script>
<script type="text/javascript" src="final.js"></script>
<script type="text/javascript" src="additional-methods.js"></script>
</head>
<body>
<form id="myform">
<input type="text" name="fname" /> <br/>
<input type="text" name="field2" /> <br/>
<input type="submit" />
</form>
</body>
</html>