-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-3.html
122 lines (110 loc) · 5.23 KB
/
test-3.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/plugins/datetimepicker/bootstrap-datetimepicker.min.css" />
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/plugins/select2/select2.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css" />
<link href="css/iconfont.css" rel="stylesheet" />
</head>
<body style="padding: 80px;">
<form class="form-horizontal" id="upForm2" autocomplete="off">
<div class="form-group">
<label class="col-sm-2 control-label">用户名:</label>
<div class="col-sm-4"><input class="form-control input-sm" required name="uname" id="uname" type="text" /></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">密码:</label>
<div class="col-sm-4"><input class="form-control input-sm" digits="true" required id="upwd" name="upwd" type="text" /></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">邮箱:</label>
<div class="col-sm-4"><input required ck-email="true" class="form-control input-sm" name="upwd2" type="text" /></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">性别:</label>
<div class="col-sm-4">
<label class="checkbox-inline i-checks">
<input type="radio" name="sex" value="option1" checked required> 男
</label>
<label class="checkbox-inline i-checks">
<input type="radio" name="sex" value="option2" required> 女
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-4">
<button type="button" class="btn btn-success btn-sm" id="butSub2">提交</button>
</div>
</div>
</form>
<script src="js/jquery-2.1.1.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
<script src="i18n/zh-CN.js" type="text/javascript"></script>
<script src="js/plugins/validate/jquery.validate.custom.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>
<script src="js/plugins/layer/layer.js" type="text/javascript" charset="utf-8"></script>
<script src="js/subindex.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="js/jquery.mockjax.min.js"></script>
<script type="text/javascript" src="demo-data.js"></script>
<script>
var ddd = $('#upForm2').validate({
rules: {
upwd: {
required: true,
remote: {
//param: {
url: "/validate/api", //后台处理程序
type: "get", //数据发送方式
data: { //要传递的数据
pwd: function () {
return $("#upwd").val();
}
},
dataFilter: function (d) { //判断控制器返回的内容
if (d == "true") {
return true;
} else {
return false;
}
}
}
},
uname: {
required: true,
remote: {
//param: {
url: "/validate/api", //后台处理程序
type: "get", //数据发送方式
data: { //要传递的数据
pwd: function () {
return $("#uname").val();
}
},
dataFilter: function (d) { //判断控制器返回的内容
if (d == "true") {
return true;
} else {
return false;
}
}
}
}
},
messages: {
upwd: {
remote: "原始密码不正确,请重新填写!"
}
},
});
$('#butSub2').click(function () {
if (!$('#upForm2').validate().form()) {
return false;
}
});
</script>
</body>
</html>