-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
101 lines (82 loc) · 5.1 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
<!DOCTYPE html>
<html ng-app="App" ng-controller="FormCtrl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Team Challenge</title>
<!-- bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/main.css"/>
<!-- load external libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>Team Challenge Form!</h1>
<br>
<div class="alert alert-success fade in" id="submitAlert">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Success!</strong> The form has been successfully submitted.
</div>
<form name="userForm" role="form" class="form-horizontal" ng-contoller="FormCtrl" novalidate>
<div class="form-group">
<label class="control-label col-sm-2" for="firstname">First Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="firstname" id="firstname" ng-model="user.firstname" placeholder="Enter First Name...">
</div>
</div>
<div class="form-group" ng-class="{ 'has-error' : userForm.lastname.$invalid && userForm.lastname.$touched }">
<label class="control-label col-sm-2" for="lastname">Last Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="lastname" id="lastname" ng-model="user.lastname" placeholder="Enter Last Name..." required>
<span ng-show="userForm.lastname.$invalid && userForm.lastname.$touched" class="help-block" id="lastnameValidate">Your last name is required.</span>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error' : userForm.email.$touched && userForm.email.$invalid }">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="email" id="email" placeholder="Enter Email..." ng-model="user.email" required>
<span ng-show="userForm.email.$touched && userForm.email.$error.required" class="help-block" id="emailBlankValidate">Enter your email.</span>
<span ng-show="userForm.email.$touched && userForm.email.$error.email" class="help-block" id="emailErrorValidate">Please enter a valid email.</span>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error' : userForm.birthdate.$invalid && !userForm.birthdate.$pristine }">
<label class="control-label col-sm-2" for="birthdate">Birthdate:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="birthdate" id="birthdate" ng-model="birthdate" placeholder="Enter date as mm/dd/yyyy" ng-change="checkBirthdate()" ng-pattern="/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/i">
<span ng-show='userForm.birthdate.$error.pattern' class="help-block" id="dateValidation">Your date format is invalid, please enter as mm/dd/yyyy!</span>
<span ng-show="checkBirthdate() && userForm.birthdate.$touched" class="help-block" id="ageCheck">You must be at least 13.</span>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error' : userForm.pw1.$invalid && userForm.pw1.$touched }">
<label class="control-label col-sm-2" for="pwd">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="pw1" id="pw1" placeholder="Enter Password..." ng-model="user.password" required>
<span ng-show="userForm.pw1.$invalid && userForm.pw1.$touched" class="help-block" id="passwordValidate">Password required!</span>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error' : userForm.pw2.$error.nxEqualEx }">
<label class="control-label col-sm-2" for="confirmpwd">Confirm Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="pw2" id="pw2" placeholder="Confirm Password..." ng-model="user.confirm" nx-equal-ex="user.password" required>
<span ng-show="userForm.pw2.$error.nxEqualEx" class="help-block" id="passwordConfirmValidate">Passwords must be equal!</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="reset" class="btn btn-default">Reset</button>
<button ng-disabled="userForm.$invalid" type="submit" class="btn btn-primary" id="formSubmit">Submit</button>
</div>
</div>
</form>
</div>
<!-- load external scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-sanitize.js"></script>
<!-- load my script -->
<script src="js/app.js"></script>
</body>
</html>