-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidation.html
More file actions
54 lines (50 loc) · 3 KB
/
Copy pathValidation.html
File metadata and controls
54 lines (50 loc) · 3 KB
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.0-rc.2/angular-messages.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-animate.js"></script>
<script src="ui-bootstrap-tpls-2.2.0.js" type="text/javascript"></script>
<script src="datetime-picker.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="validation.js" type="text/javascript"></script>
<title>Validation form</title>
</head>
<body ng-app="ngValidationForm" ng-controller="validationController">
<div class=".col-md-8 col-sm-8 col-sm-offset-2" style="padding:5px;">
<!--https://docs.angularjs.org/api/ng/type/form.FormController-->
<div class="page-header"><h1>Form Validation</h1></div>
<form name="userForm" ng-submit="submit(userForm.$valid)" novalidate>
<h3>{{ ValidationMessage }}</h3>
<div class="form-group" ng-class="{ 'has-error': userForm.email.$invalid }">
<label>Email</label>
<input type="email" name="email" class="form-control" ng-model="email" required />
<div class="help-block" ng-messages="userForm.email.$error" ng-if="userForm.email.$invalid">
<p ng-message="required">Your email is required.</p>
<p ng-message="email">Please enter a valid email address</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error': userForm.password.$invalid }">
<label>Password</label>
<input type="password" name="password" class="form-control" minlength="8" ng-model="password" required />
<div class="help-block" ng-messages="userForm.password.$error" ng-if="userForm.password.$invalid">
<p ng-message="required">Please enter a password</p>
<p ng-message="minlength">Your password must be minimum 8 character long</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error': userForm.verifypassword.$invalid }" >
<label> Confirm password</label>
<input type="password" name="verifypassword" class="form-control" ng-model="verifypassword"
my-password-verify="password" required/>
<div class="help-block" ng-messages="userForm.verifypassword.$error" ng-if="userForm.verifypassword.$invalid" >
<p ng-message="required">Please verify password</p>
<p ng-message="passverified">Password mismatch</p>
</div>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div><!-- col-sm-8 -->
</body>
</html>