15种验证
| 验证标识 | 设置值 | 描述 |
|---|---|---|
| t | 验证邮箱 | |
| phone | t | 验证手机号 |
| max | 16 | 长度不能大于设置值 |
| min | 6 | 长度不能小于设置值 |
| bank | t |
验证银行卡号 没有验证银行种类,本人太懒... |
| only | 0,1,2,3,_ |
只能用设置值类型组成 0 = 汉字 1 = 字母 2 = 数字 3 = 空字符 |
| must | 0,1,2,3,_ |
必须用设置值类型组成 同 only |
| first_must | 1 |
首位必须是设置值类型 0 = 汉字 1 = 字母 2 = 数字 3 = 空字符 |
| first_cannot | 1 |
首位不能是设置值类型 同 first_must |
| number | t |
验证货币类型 自动转化成货币类型 保留2位小数 小数位可以通过属性 decimal_places 设置 |
| idcard | t | 验证身份证 |
| equally | id,class |
值必须一致 如果多元素则取第一个元素的值进行验证 |
| date | t |
验证日期格式 例如:1996-05-21 = ture | 1996-02-30 = false |
| cannot | on |
选择值不能是设置值 此验证针对于 select |
| custom | t |
自定义验证方法 涉及很多,请看案例 |
自定义提示框
var vali_prompt = {
"Success": "Success",
"email": "Please enter the correct email address",
"phone": "Please enter the correct cell phone number",
"max": "Can not exceed {0} characters",
"min": "Not less than {0} characters",
"bank": "Please enter the correct bank card number",
"only": "Contain only",
"must": "Must contain",
"first_must": "The first must be:",
"first_cannot": "The first cannot be:",
"number": "Please enter a number",
"idcard": "Please enter the correct ID number",
"equally": "Must be the same",
"cannot": "cannot is {0}",
"date": "Please enter the correct date",
"value0": "Chinese character",
<
