-
Notifications
You must be signed in to change notification settings - Fork 7
/
form.html
288 lines (259 loc) · 8.59 KB
/
form.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>大数据智慧停车管理平台-form</title>
<link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" href="images/favicon.ico">
<!--[if lt IE 9]><script src="http://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script><![endif]-->
</head>
<body>
<header>
</header>
<div class="container">
<div class="page-header">
<h2>FORM表单</h2>
</div>
<form action="#" id="userForm" class="form-horizontal">
<h3 class="mb">form基础元素</h3>
<div class="form-group">
<label class="control-label col-sm-3" for="username">用户名</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="text" name="vo.username" class="form-control" id="username" placeholder="用户名">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3" for="password">密码</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="password" name="vo.password" class="form-control" id="password" placeholder="输入密码">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3" for="name">姓名</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="text" name="vo.name" class="form-control" id="name" placeholder="姓名">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3">权限</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<div class="radio">
<label>
<input type="radio" name="vo.isAdmin" value="1"> 管理员
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="vo.isAdmin" value="0" checked> 普通用户
</label>
</div>
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3">单选横排</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<label class="radio-inline">
<input type="radio" name="isAdmin" value="1"> 管理员(用户管理,信息管理)
</label>
<label class="radio-inline">
<input type="radio" name="isAdmin" value="0" checked> 普通用户(自有信息管理)
</label>
</div>
</div>
<!-- /.form-group -->
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3">多选</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<div class="checkbox">
<label>
<input type="checkbox" value="">
Option one is this and that—be sure to include why it's great
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" value="">
Option two
</label>
</div>
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3">多选横排</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox1" value="option1"> 1
</label>
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox2" value="option2"> 2
</label>
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox3" value="option3"> 3
</label>
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3">下拉列表</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<select class="form-control" name="ddfdf">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
</div>
<!-- /.form-group -->
<h3 class="mb">表单验证</h3>
<div class="form-group">
<label class="control-label col-sm-3" for="notNull">非空</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="text" name="feikong" class="form-control" id="notNull" placeholder="非空">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3" for="length">长度限制</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="text" name="changdu" class="form-control" id="length" placeholder="非空">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label for="birth" class="control-label col-sm-3">日期</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="text" name="date" id="birth" class="datepicker form-control" autocomplete="off">
</div>
<!-- /.col-xs-8 -->
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="pwd">密码</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="password" name="pwd" class="form-control" id="pwd" placeholder="密码">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-label col-sm-3" for="cfm">确认密码</label>
<div class="col-sm-8 col-md-6 col-lg-5">
<input type="password" name="cfmPwd" class="form-control" id="cfm" placeholder="密码">
</div>
</div>
<!-- /.form-group -->
<div class="form-group">
<div class="col-sm-offset-3 col-sm-8 col-md-offset-5 col-md-6 col-lg-offset-6 col-lg-5">
<button class="btn btn-primary" type="submit">提 交</button>
<button class="btn btn-default ml-15" data-dismiss="modal">取 消</button>
</div>
</div>
<!-- /.form-group -->
</form>
</div>
<!--
<div class="alert alert-success fade hide" id="alertBox" role="alert">
<span class="content"></span>
</div>
-->
<footer class="bs-docs-footer" role="contentinfo">
<div class="container">
<p>版权信息</p>
<p class="text-right">Developed by Yves.</p>
</div>
</footer>
<!-- 必备 -->
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="plugins/bootstrap-3.3.0/bootstrap.min.js"></script>
<!-- 表单验证 -->
<script src="plugins/bootstrapValidator/bootstrapValidator.min.js"></script>
<script src="plugins/bootstrapValidator/zh_CN.js"></script>
<!-- 日期选择器 -->
<script src="plugins/Datepicker-for-Bootstrap/bootstrap-datepicker.js"></script>
<!-- 必备,放在最下 -->
<script type="text/javascript" src="js/common.js"></script>
<!-- external scripts -->
<script type="text/javascript">
window.$ && $(function() {
/**
* 日期选择
*/
$('.datepicker').datepicker({
format: 'yyyy/mm/dd'
});
/**
* 表单验证
*/
$('#userForm').bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},//feedbackIcons
fields: {
'feikong': {//使用name属性配置
validators: {
notEmpty: {
message: '这一项不能为空。'//错误信息,可不写
}
}
},
'changdu': {
validators: {
notEmpty: {},
stringLength: {
min: 5,
max: 20
}
}
},
'date': {
validators: {
notEmpty: {},
date: {
format: 'YYYY/MM/DD',
separator:"/"
}
}
},
'pwd': {
validators: {
notEmpty: {},
stringLength: {
min: 5,
max: 20
}
}
},
'cfmPwd': {
validators: {
notEmpty: {
message: '密码不能为空'
},
callback: {
callback: function(value, validator, $field) {
if (value != $('#pwd').val()) {
return {
valid: false,
message: '两次输入密码不一致'
};
}
return true;
}
}
}
}
}//fields
});
});
</script>
</body>
</html>