Skip to content

Commit 65b1397

Browse files
committed
Improving validation demo
1 parent c18d4a9 commit 65b1397

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

‎demos/validation/demo.html‎

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,10 @@
99
<label data-abm-label>Email</label>
1010
<input type="email" name="email" class="form-control" placeholder="johndoe@mail.com" abm-form-control ng-model="user.email" required>
1111
</abm-form-group>
12-
<abm-form-group>
13-
<label>Prefered notifications via:</label>
14-
<div class="checkbox" abm-checkbox label="Text Message">
15-
<input type="checkbox" name="notifications" ng-model="user.notifications.text">
12+
<div class="form-group">
13+
<div class="togglebutton" abm-toggle label="Premium Account">
14+
<input type="checkbox" name="premiumAccount" ng-model="user.premium" ng-change="user.paymentMode=undefined">
1615
</div>
17-
<div class="checkbox" abm-checkbox label="Email">
18-
<input type="checkbox" name="notifications" ng-model="user.notifications.email">
19-
</div>
20-
</abm-form-group>
21-
<div class="togglebutton" abm-toggle label="Premium Account">
22-
<input type="checkbox" name="premiumAccount" ng-model="user.premium" ng-change="user.paymentMode=null">
2316
</div>
2417
<abm-form-group error-messages="errorMap">
2518
<label>Prefered payment method</label>
@@ -30,6 +23,34 @@
3023
<input type="radio" name="payment" value="credit" ng-model="user.paymentMode" ng-required="user.premium" ng-disabled="!user.premium">
3124
</div>
3225
</abm-form-group>
26+
<div class="form-group">
27+
<div class="togglebutton" abm-toggle label="Send Me Updates">
28+
<input type="checkbox" name="notifications" ng-model="user.notify" ng-change="user.notifications={}">
29+
</div>
30+
</div>
31+
<div class="row">
32+
<div class="col-xs-6">
33+
<abm-form-group error-messages="errorMap">
34+
<label>Notifications via:</label>
35+
<div class="checkbox" abm-checkbox label="Text Message">
36+
<input type="checkbox" name="text-notifications" ng-model="user.notifications.text" ng-disabled="!user.notify" ng-required="user.notify && !user.notifications.email">
37+
</div>
38+
<div class="checkbox" abm-checkbox label="Email">
39+
<input type="checkbox" name="email-notifications" ng-model="user.notifications.email" ng-disabled="!user.notify" ng-required="user.notify && !user.notifications.text">
40+
</div>
41+
</abm-form-group>
42+
</div>
43+
<div class="col-xs-6">
44+
<abm-form-group error-messages="errorMap">
45+
<label>Notification Frequency:</label>
46+
<select class="form-control" name="frequency" abm-form-control ng-model="user.notifications.frequency" ng-disabled="!user.notify" ng-required="user.notify">
47+
<option>Daily</option>
48+
<option>Weekly</option>
49+
<option>Monthly</option>
50+
</select>
51+
</abm-form-group>
52+
</div>
53+
</div>
3354
<a href="" class="btn btn-raised btn-primary" ng-disabled="signup.$invalid" abm-component>Create Account</a>
3455
</form>
3556
</div>

0 commit comments

Comments
 (0)