JS 验证框架 formcheck
http://mootools.floor.ch/en/labs/formcheck/forum-registration/
$(document).ready(function(){
new FormCheck('formular');
});
new FormCheck('formular');
});
代码
$(document).ready(function(){
new FormCheck('formular',
{
submitByAjax:true,
onAjaxSuccess:onajaxsuccess
});
function onajaxsuccess(arg){
if(arg==1){
ymPrompt.succeedInfo({title:'消息',message:'添加成功!'});
$("form")[0].reset();
}else{
ymPrompt.errorInfo({title:'消息',message:'添加失败!'});
}
setTimeout(function(){ymPrompt.doHandler('ok')},2000);
}
});
new FormCheck('formular',
{
submitByAjax:true,
onAjaxSuccess:onajaxsuccess
});
function onajaxsuccess(arg){
if(arg==1){
ymPrompt.succeedInfo({title:'消息',message:'添加成功!'});
$("form")[0].reset();
}else{
ymPrompt.errorInfo({title:'消息',message:'添加失败!'});
}
setTimeout(function(){ymPrompt.doHandler('ok')},2000);
}
});