jquery form validate not allow space for username field?

Posted by python on Stack Overflow See other posts from Stack Overflow or by python
Published on 2010-05-31T08:33:38Z Indexed on 2010/05/31 9:23 UTC
Read the original article Hit count: 229

Filed under:

I have used http://bassistance.de/jquery-plugins/jquery-plugin-validation/

my form validate :

$("#form_person").validate({
    rules: {


        username: {
            required: true,
            minlength: 2,
            maxlength:15
        },
        password: {
            required: true,
            minlength: 2
        },
        confirm_password: {
            required: true,
            minlength: 2,
            equalTo: "#password"
        },
        email: {
            required: true,
            email: true
        }

    },
    messages: {

        username: {
            required: "Please enter a username",
            maxlength:"max length 15 digits",
            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"
        },
        confirm_password: {
            required: "Please provide a confirm password",
            minlength: "Your password must be at least 5 characters long",
            equalTo: "Please enter the same password as above"

    }
});

Anybody help me to validate not allow space on username?

thanks

© Stack Overflow or respective owner

Related posts about jQuery