Skip to content

Commit 9c51729

Browse files
authored
Add agree policy.
1 parent fdad62a commit 9c51729

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

register.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,33 @@ <h1>Register Form</h1>
2727
<input type="text" id="email" name="email">
2828
</p>
2929

30+
<p>
31+
<label for="agree">Agree policy</label>
32+
<input type="checkbox" name="agree" id="chkAgree">
33+
</p>
34+
3035
<p>
3136
<input type="submit" id="btnRegister">
3237
<input type="reset" id="btnReset">
3338
</p>
39+
3440
</form>
3541

3642
<link rel="stylesheet" href="/asset/css/cmxform.css">
3743

3844
<style>
3945
#frmRegister label {
40-
width: 77px;
46+
width: 90px;
4147
display: inline-block;
4248
}
4349

44-
#frmRegister label.error{
50+
#frmRegister label.error {
4551
display: block;
46-
margin-left: 80px;
47-
width:250px;
52+
margin-left: 95px;
53+
width: 250px;
4854
}
4955

50-
#frmRegister #btnRegister{
56+
#frmRegister #btnRegister {
5157
margin-left: 80px;
5258
}
5359
</style>
@@ -57,28 +63,32 @@ <h1>Register Form</h1>
5763

5864
<script>
5965
$(document).ready(function () {
60-
var registerValidate= $('#frmRegister').validate({
66+
var registerValidate = $('#frmRegister').validate({
6167
rules: {
6268
firstname: "required",
6369
lastname: "required",
6470
email: {
6571
"required": true,
6672
"email": true
73+
},
74+
agree:{
75+
"required":true
6776
}
6877
},
6978
messages: {
7079
firstname: "Please enter your firstname",
7180
lastname: "Please enter your lastname",
72-
email: "Please enter your email"
81+
email: "Please enter your email",
82+
agree:"Please accept our policy"
7383
}
7484
});
7585

76-
$('#btnReset').click(function(){
86+
$('#btnReset').click(function () {
7787
registerValidate.destroy();
7888
})
7989
});
8090

8191
</script>
8292
</body>
8393

84-
</html>
94+
</html>

0 commit comments

Comments
 (0)