1 $("#form-member-add").validate({
 2         rules:{
 3             username:{
 4                 required:true,
 5                 minlength:2,
 6                 maxlength:16
 7             },
 8             mobile:{
 9                 required:true,
10                 isMobile:true,
11             },
12             companyname:{
13                 required:true,
14                 minlength:4,
15                 maxlength:30
16             }
17         },
18         onkeyup:false,
19         focusCleanup:true,
20         success:"valid",
21         submitHandler:function(form){
22             $(form).ajaxSubmit(function(data){
23                 layer.msg(data.msg);
24                 setTimeout(function () {
25                     location.replace(location.href)
26                 }, 2000);
27             });
28         }
29     });

 

posted on 2018-03-14 10:56  沐霖Sicada  阅读(590)  评论(0编辑  收藏  举报