forked from stevenmills/bootstrapvalidator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
html5.html
111 lines (100 loc) · 5.7 KB
/
html5.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
<!DOCTYPE html>
<html>
<head>
<title>FormValidation demo</title>
<link rel="stylesheet" href="../vendor/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="../dist/css/formValidation.css"/>
<script type="text/javascript" src="../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../dist/js/formValidation.js"></script>
<script type="text/javascript" src="../dist/js/framework/bootstrap.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<!-- form: -->
<section>
<div class="col-lg-8 col-lg-offset-2">
<div class="page-header">
<h2>Sign up</h2>
</div>
<form id="defaultForm" method="post" class="form-horizontal" action="target.php"
data-fv-message="This value is not valid"
data-fv-icon-valid="glyphicon glyphicon-ok"
data-fv-icon-invalid="glyphicon glyphicon-remove"
data-fv-icon-validating="glyphicon glyphicon-refresh">
<div class="form-group">
<label class="col-lg-3 control-label">Full name</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="firstName" placeholder="First name" data-fv-trigger="keyup" required data-fv-notempty-message="The first name is required and cannot be empty" />
</div>
<div class="col-lg-4">
<input type="text" class="form-control" name="lastName" placeholder="Last name" required data-fv-trigger="blur" data-fv-notempty-message="The last name is required and cannot be empty" />
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Username</label>
<div class="col-lg-5">
<input type="text" class="form-control" name="username"
data-fv-trigger="blur"
data-fv-message="The username is not valid"
required data-fv-notempty-message="The username is required and cannot be empty"
pattern="[a-zA-Z0-9_\.]+" data-fv-regexp-message="The username can only consist of alphabetical, number, dot and underscore"
minlength="5" data-fv-stringlength-message="The username must have at least 5 characters" />
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Email address</label>
<div class="col-lg-5">
<input class="form-control" name="email" type="email" required data-fv-emailaddress-message="The input is not a valid email address" />
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Website</label>
<div class="col-lg-5">
<input class="form-control" name="website" type="url" required data-fv-uri-message="The input is not a valid website address" />
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Fav color</label>
<div class="col-lg-3">
<input class="form-control" name="color" type="color" required data-fv-color-message="The input is not a valid color code" />
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Age</label>
<div class="col-lg-2">
<input type="number" class="form-control" name="age" step="1"
min="10" data-fv-greaterthan-inclusive="false" data-fv-greaterthan-message="The input must be greater than or equal to 10"
max="100" data-fv-lessthan-inclusive="true" data-fv-lessthan-message="The input must be less than 100"
/>
<!--<input type="range" class="form-control" name="age"
required
min="10" max="100" data-fv-between-message="The input must be between 10 and 100"
/>-->
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Bio</label>
<div class="col-lg-5">
<textarea class="form-control" name="bio" rows="10" data-fv-stringlength data-fv-stringlength-max="100" data-fv-stringlength-message="The bio must be less than 100 characters long"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-lg-9 col-lg-offset-3">
<button type="submit" class="btn btn-primary">Sign up</button>
</div>
</div>
</form>
</div>
</section>
<!-- :form -->
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#defaultForm').formValidation();
});
</script>
</body>
</html>