-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyAcct-table-validation.html
403 lines (353 loc) · 17.6 KB
/
MyAcct-table-validation.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="bootstrap/assets/ico/favicon.png">
<title>DE - My Account - table validation</title>
<!-- Reference to DEB Styleguide customized Bootstrap core CSS -->
<link href="http://torwed50:92/StyleGuide-Boilerplate/Content/bootstrap/bootstrap.css" rel="stylesheet">
<!-- Reference to DEB Styleguide PATTERNS CSS -->
<link href="http://torwed50:92/StyleGuide-Boilerplate/Content/sass/main.css" rel="stylesheet">
<!-- Bootstrap core CSS -->
<!-- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">-->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Bootstrap validator -->
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.2/css/bootstrapValidator.min.css" />
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
<style type="text/css">
</style>
</head>
<body class="body-unauth">
<div class="container-fluid">
<div id="registerContainer">
<div class="row">
<div class="col-xs-12">
<h1>MyAccount table validation</h1>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<table class="table table-bordered">
<thead>
<tr>
<th>Volume</th>
<th>Price</th>
<th>Option</th>
<th>Percent<br><label><input type="checkbox">Apply all</label></th>
<th>Value 1</th>
<th>value 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>2000</td>
<td>$2.95</td>
<td><select id="selPercent" class="form-control">
<option value="25">25%</option>
<option value="50">50%</option>
<option value="75">75%</option>
<option value="custom">Custom</option>
<option value="remaining">Remaining</option>
</select></td>
<td><input id="txtPercent" type="number" class="form-control">first value</td>
<td><input id type="number" class="form-control">second value</td>
<td><input type="number" class="form-control">second value</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div>
<div class="alert alert-danger hidden" id="de-form-submission-message"><i class="fa fa-exclamation-circle"></i> {{errormsg}}</div>
<form role="form" name="registerForm" id="registerForm">
<p>View and manage your Direct Energy Business accounts any time of the day.</p>
<p>To access My Account, complete the information below using your account number and zip code from your Direct Energy Business invoice</p>
<h4 class="top20">Your Information</h4>
<div class="form-group">
<label class="control-label" for="inputFirstname">First name</label>
<input type="text" class="form-control" name="inputFirstname" id="inputFirstname">
</div>
<div class="form-group">
<label class="control-label" for="inputLastname">Last name</label>
<input type="text" class="form-control" name="inputLastname" id="inputLastname">
</div>
<div class="form-group">
<label class="control-label" for="inputUsername">Email address / User name</label>
<input type="text" class="form-control" name="inputUsername" id="inputUsername">
</div>
<div class="form-group">
<label class="control-label" for="inputPassword">Password</label>
<input type="password" class="form-control" name="inputPassword" id="inputPassword">
<div id="pwd_strength_wrap_well" class="well">
<div id="passwordDescription"></div>
<div id="passwordStrength" class="strength{{strength}}"></div>
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputConfirmPassword">Confirm Password</label>
<input type="password" class="form-control" name="inputConfirmPassword" id="inputConfirmPassword">
</div>
<div class="row spacer10"></div>
<h4>Account Information</h4>
<p>If you have multiple accounts, you can register using any account number. You will have access to all accounts after you complete registration</p>
<div class="alert alert-success" ng-show="customerExists==1"><i class="fa fa-check-circle" ng-show="customerExists==1"></i></div>
<div class="alert alert-danger" ng-show="customerExists==-1"><i class="fa fa-exclamation-circle" ng-show="customerExists==-1"></i></div>
<div class="form-group">
<label class="control-label" for="inputAccountnumber">Account number</label>
<input type="text" class="form-control" name="inputAccountnumber" id="inputAccountnumber">
</div>
<div class="form-group">
<label class="control-label" for="inputZipcode">Zip code</label>
<input type="text" class="form-control" name="inputZipcode" id="inputZipcode">
</div>
<div class="btn-toolbar text-right">
<a href="#" class="btn btn-link">Cancel</a>
<button type="submit" class="btn btn-primary btn-lg" id="RegisterButton" value="Register">Register Now</button>
</div>
</form>
</div>
</div>
</div>
<style type="text/css">
.de-trigger-weighted-avg > div {
background-color: #cccccc;
}
.de-trigger-weighted-avg div:first-child .input-group {
background-color: #fbbb96;
}
.de-trigger-weighted-avg div:first-child .input-group label {
padding-bottom: 1rem;
padding-left: 0.5rem;
padding-top: 10px;
}
.de-trigger-weighted-avg div:last-child .input-group {
padding-bottom: 1rem;
padding-top: 10px;
}
.de-trigger-weighted-avg .input-group-addon{
background-color: #F05D21;
border-radius: 0;
}
</style>
<div class="row top10 de-trigger-weighted-avg">
<div class="col-sm-6">
<!--
<div class="checkbox">
<label><input type="checkbox" ng-click="showWeightedAverage()" ng-model="applyWeightedAverage" />Apply Buy at Market Weighted Average Price to this request <a popover="@Html.Action("HelpText", "Sitecore", new { contentId = Constants.SitecoreCalloutIdSettings.GetSettingByName("Trigger-Hover-Buy-Market").Result })" popover-trigger="mouseenter" popover-placement="right" popover-append-to-body="true"><i class="fa fa-question-circle"></i></a></label>
</div>
-->
<div class="input-group input-group-lg">
<span class="input-group-addon">
<input type="checkbox" id="de-trigger-checkbox-weighted-average" ng-click="showWeightedAverage()" ng-model="applyWeightedAverage" />
</span>
<label for="de-trigger-checkbox-weighted-average">Apply Buy at Market Weighted Average Price to this request <a popover="@Html.Action("HelpText", "Sitecore", new { contentId = Constants.SitecoreCalloutIdSettings.GetSettingByName("Trigger-Hover-Buy-Market").Result })" popover-trigger="mouseenter" popover-placement="right" popover-append-to-body="true"><i class="fa fa-question-circle"></i></a></label>
</div><!-- /input-group -->
</div>
<div class="col-sm-6">
<div class="input-group input-group-lg" ng-show="applyWeightedAverage">
<label><strong>Weighted Average Buy at Market Price ${{weightedAverage | number:3}}</strong></label>
</div>
</div>
</div>
</div>
</div>
<!-- End Container fluid-->
<footer class="de-myact-footer">
<div class="container-fluid">
<!-- footer container -->
<div class="row">
<div class="de-copyright col-xs-12">©2014 Direct Energy Marketing Limited, a subsidiary of <a href="#">Centrica</a> plc. Direct Energy and the Lightning Bolt design are either registered trademarks or trademarks of Direct Energy Marketing Limited in the United States and/or Canada. Use of such trademarks has been licensed by Direct Energy Marketing Limited to its various subsidiaries and affiliates. Direct Energy Business, LLC (DC PSC License No. EA-04-4-4; MD PSC License Nos. IR-437; IR-719; IR-791; PUCT Cert. No. 10011). Products and services vary depending on region or market.
</div>
</div>
</div>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- jQuery CDN -->
<script src="http://code.jquery.com/jquery.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- jquery password strength -->
<script src="js/libs/jquery.pwstrength.bootstrap/dist/pwstrength-bootstrap-1.2.0.js"></script>
<!-- Bootstrap validator -->
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.2/js/bootstrapValidator.min.js"></script>
<script type="text/javascript">
// Form validation functions
$(document).ready(function () {
/* custom validator function. Used for acccount number validation */
$.fn.bootstrapValidator.validators.password = {
validate: function(validator, $field, options) {
var value = $field.val();
if (value === '') {
return true;
}
if (value.length < 8) {
return false;
}
if (value === value.toLowerCase()) {
return false;
}
if (value === value.toUpperCase()) {
return false;
}
if (value.search(/[0-9]/) < 0) {
return false;
}
return true;
}
};
$('#registerForm').bootstrapValidator({
// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
feedbackIcons: {
valid: 'fa fa-check fa-lg',
invalid: 'fa fa-times',
validating: 'fa fa-refresh'
/* required: 'glyphicon glyphicon-asterisk',
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
*/ },
fields: {
inputFirstname: {
message: 'First name is not valid',
validators: {
notEmpty: {
message: 'First name is required'
},
regexp: {
regexp: /^[a-zA-Z0-9]+$/,
message: 'First name can only consist of alphabetical and number'
}
}
},
inputLastname: {
message: 'Last name is not valid',
validators: {
notEmpty: {
message: 'Last name is required'
},
regexp: {
regexp: /^[a-zA-Z0-9]+$/,
message: 'Last name can only consist of alphabetical and number'
}
}
},
inputUsername: {
message: 'User name is not valid',
validators: {
notEmpty: {
message: 'User name is required'
},
emailAddress: {
message: 'User name is not a valid email address'
},
different: {
field: 'inputPassword',
message: 'User name and Password cannot be the same'
}
}
},
inputPassword: {
message: 'Password is not valid',
validators: {
notEmpty: {
message: 'Password is required'
},
different: {
field: 'inputUsername',
message: 'Password cannot be the same as user name'
},
stringLength: {
min: 8,
message: 'Password must have at least 8 characters'
},
identical: {
field: 'inputConfirmPassword',
message: 'Password and confirm password are not the same'
}
}
},
inputConfirmPassword: {
validators: {
notEmpty: {
message: 'Confirm password is required'
},
different: {
field: 'inputUsername',
message: 'Password cannot be the same as user name'
},
stringLength: {
min: 8,
message: 'Password must have at least 8 characters'
},
identical: {
field: 'inputPassword',
message: 'Password and confirm password are not the same'
}
}
},
inputAccountnumber: {
validators: {
notEmpty: {
message: 'Account number is required'
},
stringLength: {
min: 8,
message: 'Account number must have at least 8 characters'
}
}
},
inputZipcode: {
validators: {
notEmpty: {
message: 'Zip code is required'
},
zipCode: {
country: 'US',
message: 'The value is not valid US zip code'
}
}
},
chkReadtac: {
validators: {
notEmpty: {
message: 'You must accept the Terms and conditions.'
}
}
}
}
});
});
// displaying form submission error messages
$('#RegisterButton').click(function () {
if ($('#inputPassword').val() == 'error') {
$('#de-form-submission-message').removeClass('hidden')
return false;
};
});
// password strength meter
$(document).ready(function () {
$('#inputPassword').pwstrength({
bootstrap3: true,
ui: {
showVerdictsInsideProgressBar: true,
container: "#de-pwd-strength",
viewports: {
progress: ".pwstrength_viewport_progress"
}
}
});
});
</script>
</body>
</html>