-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
182 lines (176 loc) · 7.13 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="./bootstrap.min.css" title="" rel="stylesheet" />
<style>
*{
font-family: "楷体";
}
#code_email {
position: absolute;
top: 0px;
margin-top: 100px;
width: 380px;
left: 50%;
margin-left: -190px;
z-index: 11;
background: #ffffff;
border: 1px solid #ccc;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0px 0px 0px #ccc;
-moz-box-shadow: 0px 0px 0px #ccc;
box-shadow: 0px 0px 0px #ccc;
display: none;
}
#code_email .head_email {
width: 100%;
font-size: 16px;
text-align: center;
padding: 6px;
background: #e9e4d3;
color: #000000;
margin-bottom: 10px;
}
#code_email .input_div {
text-align: center;
margin: 20px auto;
}
div{
margin-bottom:10px;
}
#code_email .input_div input {
width:200px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 1px solid #ccc;
padding-left: 8px;
height: 30px;
line-height: 30px;
}
#code_email .input_div span{
display: block;
}
#code_email .input_div .btn {
padding: 6px 20px;
margin-top:5px;
display: inline;
-webkit-box-shadow: 0px 0px 10px #ccc;
-moz-box-shadow: 0px 0px 10px #ccc;
box-shadow: 0px 0px 10px #ccc;
color:#000;
}
.code_div{
display: none;
}
.input_div{
width:270px;
}
#code_email .input_div span{
border:1px solid #fff;
text-align: left;
text-indent: 65px;
padding:0px;
color:red;
font-size:12px;
}
#code_email .input_div input[type='radio'] ,#code_email .input_div input[type='checkbox']{
width:15px;
}
</style>
<title>Document</title>
</head>
<body>
<div id="code_email" style="display: block;">
<div class="head_email">
<label>表单验证器,表单name值可以自定义,输入外层默认用div包裹</label><br>
</div>
<div class="input_div email_div">
<div>
<div class="input_code">
<label >邮 箱:</label>
<input style="width:190px" type="email" name="user_email" value="" inputType="on" validate="on"
empty-data="验证邮箱不能为空" error-data="邮箱格式不正确" validate-method ='5'>
</div>
<div class="input_code">
<label>用户名:</label>
<input style="width:190px;" type="email" name="user_name" value="" inputType="on" validate="off"
empty-data="用户名不能为空" error-data="用户名为全中文的" validate-method='8'>
</div>
<div class="input_code">
<label>手机号:</label>
<input style="width:190px;" type="email" name="user_phone" value="" inputType="on" validate="off"
empty-data="手机号不能为空" error-data="手机号格式不正确" validate-method='3'>
</div>
<div class="input_code">
<label>ip验证:</label>
<input style="width:190px;" type="email" name="user_ip" value="" inputType="on" validate="off"
empty-data="ip不能为空" error-data="ip格式不正确" validate-method='9'>
</div>
<div class="input_code">
<label>验证url:</label>
<input style="width:190px;" type="email" name="user_url" value="" inputType="on" validate="off"
empty-data="url不能为空" error-data="url格式不正确" validate-method='10'>
</div>
<div class="input_code">
<label>正整数:</label>
<input style="width:190px;" type="email" name="user_integer" value="" inputType="on" validate="off"
empty-data="内容不能为空" error-data="内容格式不正确" validate-method='11'>
</div>
<div class="input_code">
<label>负整数:</label>
<input style="width:190px;" type="email" name="negative_integer" value="" inputType="on" validate="off"
empty-data="内容不能为空" error-data="内容格式不正确" validate-method='12'>
</div>
<div class="input_code">
<label>单选框:</label>
<input type="radio" name="Radio" id="" empty-data="内容不能为空" error-data="" inputType="off" validate="off">单选1
<input type="radio" name="Radio" id="">单选2
<input type="radio" name="Radio" id="">单选3
</div>
<div class="input_code">
<label>多选框:</label>
<input type="checkbox" name="checkbox[]" id="" empty-data="多选不能为空" error-data="做多选择2个" inputType="off" validate="off" Checkmin='1' Checkmax='2'>多选1
<input type="checkbox" name="checkbox[]" id="">多选2
<input type="checkbox" name="checkbox[]" id="">多选3
</div>
<div class="input_code">
<label>下拉框:</label>
<select name="select" style="width:190px;" validate='off' empty-data='下拉框不能为空' error-data="下拉框选择不正确" >
<option value ="">空</option>
<option value ="1">Volvo</option>
<option value ="2">Volvo1</option>
<option value ="3">Volvo2</option>
</select>
</div>
<div class="input_code">
<label>文本输入:</label>
<textarea name="textarea" textarea='on' id="" cols="24" rows="5" validate='off' empty-data='文本输入不能为空' error-data="文本输入验证为全中文" validate-method='8'></textarea>
</div>
</div>
<div style="clear:both;height: 6px;"></div>
<div><span class="btn">发送</span></div>
</div>
</div>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="./Guardian.js"></script>
<script>
Guardian = new Object(Guardian);
Guardian.init($('.email_div'),$('.btn'));
$('.btn').click(function(){
if(Guardian.is_ok()){
alert('验证通过')
}
})
setTimeout(function(){
$('.email_div').append('');
})
</script>
</body>
</html>