按规则配置字段
var validRule=[
'require':['email','password'],
'email':['email'],
...
];
分字段配置规则
var validFields=[
'username':['require'],
'password':['require'],
'email':['email']
]
表单验证这两种方式那种更好一些?
按规则配置字段
var validRule=[
'require':['email','password'],
'email':['email'],
...
];
分字段配置规则
var validFields=[
'username':['require'],
'password':['require'],
'email':['email']
]
表单验证这两种方式那种更好一些?