| $ (). Ready (function () { |
|
|
|
$ ("#empForm"). Validate ({ |
|
rules:{ |
|
Realname: "Required", |
|
username:{ |
|
Required:true, |
|
rangelength:[5,8] |
|
}, |
|
psw:{ |
|
Required:true, |
|
RANGELENGTH:[6,12] |
|
}, |
|
psw2:{ |
|
Required:true, |
|
RANGELENGTH:[6,12], |
|
Equalto: "#psw" |
|
}, |
|
Gender: "Required", |
|
age:{ |
|
Required:true, |
|
RANGE:[26,50] |
|
}, |
|
Edu: "Required", |
|
birthday:{ |
|
Required:true, |
|
Dateiso: "Yyyy/mm/dd" |
|
}, |
|
CheckBox1: "Required", |
|
email:{ |
|
Required:true, |
|
Email: "True" |
|
}, |
|
cart:{ |
|
Required:true, |
|
Cartlength:true, |
|
Cartcheck:true |
|
} |
|
}, |
|
messages:{ |
|
Realname: "True name cannot be empty", |
|
username:{ |
|
Required: "Login name cannot be empty", |
|
Rangelength: "The length of the login should be between 5 and 8" |
|
}, |
|
psw:{ |
|
Required: "Password cannot be empty", |
|
Rangelength: "The length of the password should be between 6 and 12" |
|
}, |
|
psw2:{ |
|
Required: "Password cannot be empty", |
|
Rangelength: "The length of the password should be between 6 and 12", |
|
Equalto: "Two times password input inconsistency" |
|
}, |
|
Gender: "You do not have a third option",//If you are prompted to set its corresponding label label on the page, you can not set the relevant content in the information tip of the validation rule |
|
age:{ |
|
Required: "Age cannot be empty", |
|
Range: "Age must be between 26 and 50" |
|
}, |
|
Edu: "Choose at least one degree", |
|
birthday:{ |
|
Required: "Date of birth cannot be empty", |
|
Dateiso: "Birth date format is incorrect" |
|
}, |
|
email:{ |
|
Required: "Email cannot be empty", |
|
Email: "The email address is not in the correct format" |
|
}, |
|
cart:{ |
|
Required: "The ID number cannot be empty", |
|
Cartlength: "The ID number is not the correct length", |
|
Cartcheck: "The format of the identity card number is incorrect" |
|
} |
|
} |
|
}); |
|
|
|
}); |
|