I am using JQuery to validate a form and would like to make the chosenUsername field only accept alphanumeric characters without spaces. I can't seem to find a rule to do this though - what can I do?
$('.theForm').validate({
errorElement: 'label', //default input error message container
errorClass: 'help-inline', // default input error message class
focusInvalid: false, // do not focus the last invalid input
ignore: "",
rules: {
chosenUsername: {
required: true,
minlength: 4
}
},
messages: { // custom messages for radio buttons and checkboxes
message: {
required: "Please enter a username of at least 4 characters.",
minlength: "Minimum of 4 characters."
}
},
Thank you! Arbiter