formcheck 自定义验证
POST提交前的验证:
formcheck= new FormCheck('formular',{onSubmit:onsubmitfun});
onSubmit:onsubmitfun提交前的验证function方法
formcheck.options.submit=false时就不提交了
自定义验证function方法:
<input type="text" name="custom" class="validate['required','%customCheck">
validate['required','%customCheck']
customCheck自定义验证function方法
function customCheck(el){
if (!el.value.test(/^[A-Z]/)) {
el.errors.push("Username should begin with an uppercase letter");
return false;
} else {
return true;
}
}
if (!el.value.test(/^[A-Z]/)) {
el.errors.push("Username should begin with an uppercase letter");
return false;
} else {
return true;
}
}