-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontactEdit.html
89 lines (89 loc) · 5.61 KB
/
contactEdit.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
<div class="main" ng-controller="ContactCreateCtrl">
<div class="container">
<form name="createContactForm" novalidate>
<div>
<h1>Create Contact</h1>
</div>
<br />
<div class="row">
<div class="col-xs-12 col-md-4">
<input ng-model="first_name" class="form-control" name="first_name" placeholder="First Name" type="text" />
<span style="color: red" ng-show="createContactForm.first_name.$dirty && createContactForm.first_name.$invalid">
<span ng-show="createContactForm.first_name.$error.required">First Name is required.</span>
</span>
</div>
<div class="col-xs-12 col-md-4">
<input ng-model="last_name" class="form-control" name="last_name" placeholder="Last Name" type="text" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.last_name.$dirty && createContactForm.last_name.$invalid">
<span ng-show="createContactForm.last_name.$error.required">Last Name is required.</span>
</span>
</div>
<div class="col-xs-12 col-md-4">
<input ng-model="company_name" class="form-control" name="company_name" placeholder="Company Name" type="text" ng-change="change()" />
</div>
</div>
<br />
<div class="row">
<div class="col-xs-12 col-md-5">
<input ng-model="address" class="form-control" name="address" placeholder="Address" type="text" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.address.$dirty && createContactForm.address.$invalid">
<span ng-show="createContactForm.address.$error.required">Address is required.</span>
</span>
</div>
<div class="col-xs-12 col-md-3">
<input ng-model="city" class="form-control" name="city" placeholder="City" type="text" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.city.$dirty && createContactForm.city.$invalid">
<span ng-show="createContactForm.city.$error.required">City is required.</span>
</span>
</div>
<div class="col-xs-12 col-md-2">
<input ng-model="state" class="form-control" name="state" placeholder="State" type="text" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.state.$dirty && createContactForm.state.$invalid">
<span ng-show="createContactForm.state.$error.required">State is required.</span>
</span>
</div>
<div class="col-xs-12 col-md-2">
<input ng-model="zip" class="form-control" name="zip" placeholder="Zip Code" type="number" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.zip.$dirty && createContactForm.zip.$invalid">
<span ng-show="createContactForm.zip.$error.required">Zip code is required.</span>
<span ng-show="createContactForm.email.$error.email">Zip code must be numeric.</span>
</span>
</div>
</div>
<br />
<div class="row">
<div class="col-xs-12 col-md-2">
<input ng-model="phone" class="form-control" name="phone" placeholder="Phone" type="tel" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.phone.$dirty && createContactForm.phone.$invalid">
<span ng-show="createContactForm.phone.$error.required">Phone number is required.</span>
<span ng-show="createContactForm.email.$error.email">Not a valid phone number.</span>
</span>
</div>
<div class="col-xs-12 col-md-2">
<input ng-model="work_phone" class="form-control" name="work_phone" placeholder="Work Phone" ng-change="change()" type="tel" />
</div>
<div class="col-xs-12 col-md-4">
<input ng-model="email" class="form-control" name="email" placeholder="Email" type="email" ng-change="change()" required />
<span style="color: red" ng-show="createContactForm.email.$dirty && createContactForm.email.$invalid">
<span ng-show="createContactForm.email.$error.required">Email is required.</span>
<span ng-show="createContactForm.email.$error.email">Not a valid email.</span>
</span>
</div>
<div class="col-xs-12 col-md-4">
<input ng-model="url" class="form-control" name="url" placeholder="URL" type="url" ng-change="change()" />
<span style="color: red" ng-show="createContactForm.phone.$dirty && createContactForm.phone.$invalid">
<span ng-show="createContactForm.email.$error.email">Not a valid phone url.</span>
</span>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-12 col-md-12">
<!--<a ng-click="addContact($event)" class="btn send btn-primary" ng-disabled="(createContactForm.first_name.$dirty && createContactForm.first_name.$invalid || createContactForm.first_name.$pristine) || (createContactForm.last_name.$dirty && createContactForm.last_name.$invalid || createContactForm.last_name.$pristine) || (createContactForm.address.$dirty && createContactForm.address.$invalid || createContactForm.address.$pristine) || (createContactForm.city.$dirty && createContactForm.city.$invalid || createContactForm.city.$pristine) || (createContactForm.state.$dirty && createContactForm.state.$invalid || createContactForm.state.$pristine) || (createContactForm.zip.$dirty && createContactForm.zip.$invalid || createContactForm.zip.$pristine) || (createContactForm.phone.$dirty && createContactForm.phone.$invalid || createContactForm.phone.$pristine) || (createContactForm.email.$dirty && createContactForm.email.$invalid || createContactForm.email.$pristine)">Edit Contact</a>-->
<a ng-click="updateScope(); editContact()" class="btn send btn-primary">Edit Contact</a>
<input type="reset" class="btn btn-primary" id="reset" value="Reset" ng-click="reset()" />
</div>
</div>
</form>
</div>
</div>