OK, I’m trying to get the alphanumeric/additional methods working with the validation plugin, but so far, I can’t make it fire. I’ve read through the plugin docs and multiple example on Stack and it just isn’t doing the validation. It’s not throwing any errors either. Anyone see what I’m missing?
here’s the JS:
<script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="scripts/jquery-validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="scripts/jquery-validation/additional-methods.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var validator=$("#registration").validate({
rules: {
"user_name": {
required: true,
alphanumeric: true,
rangelength: [7, 15]
}
},
messages: {
"user_name": {
required: "You must enter a Username",
alphanumeric: "Login format not valid",
rangelength: "Username improper length"
}
}
});
});
</script>
Lot’s of noobies, and I’m not saying you’re one, come to forums like this asking for help with jquery, plug-ins or whatever, thinking that jquery is some sort of shortcut to learning javascript (when it clearly isn’t) and also not realising that what they want to do can very often be done much easier with vanilla javascript and always with much less code if they go look at the code jquery runs in the background to perform a given task.