-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
72 lines (71 loc) · 2.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>基于Jquery的轻量级bootstrap检验插件</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<h2 style="text-align:center;">基于Jquery的轻量级bootstrap检验插件</h2>
<br><br>
<div class="row form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label form-label">名 称:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="card_name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="card_name1">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">邮 箱:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="card_name2">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">其 他:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="card_name3">
</div>
</div>
</div>
<div class="row">
<div class="form-group btn-group col-md-offset-4">
<button class="btn btn-success" onclick="toValidate()">提 交</button>
</div>
</div>
</body>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/validate.js"></script>
<script>
function toValidate(){
var val = new validate({
/*rules里面是检验规则,
*key为需要检验的input的id,
*value为此input对应的检验规则
*/
rules:{
card_name:"notEmpty",
card_name1:"mobile",
card_name2:"email",
card_name3:"notEmpty"
},
/*submitFun里面为检验成功后要执行的方法*/
submitFun:function(){
toSubmit();
}
})
}
function toSubmit(){
alert("验证通过,提交啦 !!!")
}
</script>
</html>