I have a JS code that the function must check the form, now what I want to do is add 1 function to prevent a space in the text box with the message too: "No space". Here it is my JS code:
$().ready(function() { $("#signupForm").validate( { rules: { full_name: "required", username: { required: true, minlength: 2 }, password: { required: true, minlength: 5 }, email: { required: true, email: true }, }, messages: { full_name: "Please enter your full name", username: { required: "Please enter a username", minlength: "Your username must consist of at least 2 characters" }, password: { required: "Please provide a password", minlength: "Your password must be at least 5 characters long" }, email: "Please enter a valid email address" } }); });
Can anyone give me an idea? Thanks.
source share