-
Notifications
You must be signed in to change notification settings - Fork 0
/
validation.php
464 lines (391 loc) · 17.6 KB
/
validation.php
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
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
<?php
//initilize the page
require_once("inc/init.php");
//require UI configuration (nav, ribbon, etc.)
require_once("inc/config.ui.php");
/*---------------- PHP Custom Scripts ---------
YOU CAN SET CONFIGURATION VARIABLES HERE BEFORE IT GOES TO NAV, RIBBON, ETC.
E.G. $page_title = "Custom Title" */
$page_title = "Smart Form Validation";
/* ---------------- END PHP Custom Scripts ------------- */
//include header
//you can add your custom css in $page_css array.
//Note: all css files are inside css/ folder
$page_css[] = "your_style.css";
include("inc/header.php");
//include left panel (navigation)
//follow the tree in inc/config.ui.php
$page_nav["forms"]["sub"]["smart_validation"]["active"] = true;
include("inc/nav.php");
?>
<!-- ==========================CONTENT STARTS HERE ========================== -->
<!-- MAIN PANEL -->
<div id="main" role="main">
<?php
//configure ribbon (breadcrumbs) array("name"=>"url"), leave url empty if no url
//$breadcrumbs["New Crumb"] => "http://url.com"
$breadcrumbs["Forms"] = "";
include("inc/ribbon.php");
?>
<!-- MAIN CONTENT -->
<div id="content">
<div class="row">
<div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
<h1 class="page-title txt-color-blueDark">
<i class="fa fa-edit fa-fw "></i>
Forms
<span>>
Validation Sample look
</span>
</h1>
</div>
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-8">
<ul id="sparks" class="">
<li class="sparks-info">
<h5> My Income <span class="txt-color-blue">$47,171</span></h5>
<div class="sparkline txt-color-blue hidden-mobile hidden-md hidden-sm">
1300, 1877, 2500, 2577, 2000, 2100, 3000, 2700, 3631, 2471, 2700, 3631, 2471
</div>
</li>
<li class="sparks-info">
<h5> Site Traffic <span class="txt-color-purple"><i class="fa fa-arrow-circle-up" data-rel="bootstrap-tooltip" title="Increased"></i> 45%</span></h5>
<div class="sparkline txt-color-purple hidden-mobile hidden-md hidden-sm">
110,150,300,130,400,240,220,310,220,300, 270, 210
</div>
</li>
<li class="sparks-info">
<h5> Site Orders <span class="txt-color-greenDark"><i class="fa fa-shopping-cart"></i> 2447</span></h5>
<div class="sparkline txt-color-greenDark hidden-mobile hidden-md hidden-sm">
110,150,300,130,400,240,220,310,220,300, 270, 210
</div>
</li>
</ul>
</div>
</div>
<div class="alert alert-block alert-info">
<a class="close" data-dismiss="alert" href="#">×</a>
<h4 class="alert-heading">Please Note!</h4>
<p>
This page only shows various form element states for error and success. For a full list of error validations and examples click on the link below to go to the <strong>Smart Form Layouts</strong> page
</p>
<br>
<a href="<?php echo APP_URL; ?>/form-templates.php" class="btn btn-primary"><strong><i class="fa fa-arrow-circle-right"></i> Form Layouts Page </strong></a>
</div>
<!-- widget grid -->
<section id="widget-grid" class="">
<!-- row -->
<div class="row">
<!-- NEW WIDGET START -->
<article class="col-sm-12 col-md-12 col-lg-6">
<!-- Widget ID (each widget will need unique ID)-->
<div class="jarviswidget" id="wid-id-0" data-widget-colorbutton="false" data-widget-editbutton="false">
<!-- widget options:
usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
data-widget-colorbutton="false"
data-widget-editbutton="false"
data-widget-togglebutton="false"
data-widget-deletebutton="false"
data-widget-fullscreenbutton="false"
data-widget-custombutton="false"
data-widget-collapsed="true"
data-widget-sortable="false"
-->
<header>
<span class="widget-icon"> <i class="fa fa-exclamation txt-color-red"></i> </span>
<h2>Error States </h2>
</header>
<!-- widget div-->
<div>
<!-- widget edit box -->
<div class="jarviswidget-editbox">
<!-- This area used as dropdown edit box -->
</div>
<!-- end widget edit box -->
<!-- widget content -->
<div class="widget-body no-padding">
<!-- Error states for elements -->
<form class="smart-form">
<header>Error states for elements</header>
<fieldset>
<section>
<label class="label">Text input</label>
<label class="input state-error">
<input type="text">
</label>
<div class="note note-error">This is a required field.</div>
</section>
<section>
<label class="label">File input</label>
<div class="input input-file state-error">
<span class="button"><input type="file" id="file2" onchange="this.parentNode.nextSibling.value = this.value">Browse</span><input type="text" readonly>
</div>
<div class="note note-error">File size must be less than 3Mb.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Select</label>
<label class="select state-error">
<select>
<option value="0">Choose name</option>
<option value="1">Alexandra</option>
<option value="2">Alice</option>
<option value="3">Anastasia</option>
<option value="4">Avelina</option>
</select>
<i></i>
</label>
<div class="note note-error">You must select an option.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Textarea</label>
<label class="textarea state-error">
<textarea rows="3"></textarea>
</label>
<div class="note note-error">This is a required field.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Radios</label>
<div class="row">
<div class="col col-4">
<label class="radio state-error"><input type="radio" name="radio"><i></i>Alexandra</label>
<label class="radio state-error"><input type="radio" name="radio"><i></i>Alice</label>
</div>
<div class="col col-4">
<label class="radio state-error"><input type="radio" name="radio"><i></i>Avelina</label>
<label class="radio state-error"><input type="radio" name="radio"><i></i>Basilia</label>
</div>
<div class="col col-4">
<label class="radio state-error"><input type="radio" name="radio"><i></i>Cassandra</label>
<label class="radio state-error"><input type="radio" name="radio"><i></i>Clemencia</label>
</div>
</div>
<div class="note note-error">You must select one option.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Checkboxes</label>
<div class="row">
<div class="col col-4">
<label class="checkbox state-error"><input type="checkbox" name="checkbox"><i></i>Alexandra</label>
<label class="checkbox state-error"><input type="checkbox" name="checkbox"><i></i>Alice</label>
</div>
<div class="col col-4">
<label class="checkbox state-error"><input type="checkbox" name="checkbox"><i></i>Avelina</label>
<label class="checkbox state-error"><input type="checkbox" name="checkbox"><i></i>Basilia</label>
</div>
<div class="col col-4">
<label class="checkbox state-error"><input type="checkbox" name="checkbox"><i></i>Cassandra</label>
<label class="checkbox state-error"><input type="checkbox" name="checkbox"><i></i>Clemencia</label>
</div>
</div>
<div class="note note-error">You must select at least one option.</div>
</section>
</fieldset>
<fieldset>
<div class="row">
<section class="col col-5">
<label class="label">Toggles based on radios</label>
<label class="toggle state-error"><input type="radio" name="radio-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Alexandra</label>
<label class="toggle state-error"><input type="radio" name="radio-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Anastasia</label>
<label class="toggle state-error"><input type="radio" name="radio-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Avelina</label>
<div class="note note-error">You must select one option.</div>
</section>
<div class="col col-2"></div>
<section class="col col-5">
<label class="label">Toggles based on checkboxes</label>
<label class="toggle state-error"><input type="checkbox" name="checkbox-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Cassandra</label>
<label class="toggle state-error"><input type="checkbox" name="checkbox-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Clemencia</label>
<label class="toggle state-error"><input type="checkbox" name="checkbox-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Desiderata</label>
<div class="note note-error">You must select at least one option.</div>
</section>
</div>
</fieldset>
<footer>
<button type="submit" class="btn btn-primary">Submit</button>
<button type="button" class="btn btn-default" onclick="window.history.back();">Back</button>
</footer>
</form>
<!--/ Error states for elements -->
</div>
<!-- end widget content -->
</div>
<!-- end widget div -->
</div>
<!-- end widget -->
</article>
<!-- WIDGET END -->
<!-- NEW WIDGET START -->
<article class="col-sm-12 col-md-12 col-lg-6">
<!-- Widget ID (each widget will need unique ID)-->
<div class="jarviswidget" id="wid-id-2" data-widget-colorbutton="false" data-widget-editbutton="false">
<!-- widget options:
usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
data-widget-colorbutton="false"
data-widget-editbutton="false"
data-widget-togglebutton="false"
data-widget-deletebutton="false"
data-widget-fullscreenbutton="false"
data-widget-custombutton="false"
data-widget-collapsed="true"
data-widget-sortable="false"
-->
<header>
<span class="widget-icon"> <i class="fa fa-check txt-color-green"></i> </span>
<h2>Success States </h2>
</header>
<!-- widget div-->
<div>
<!-- widget edit box -->
<div class="jarviswidget-editbox">
<!-- This area used as dropdown edit box -->
</div>
<!-- end widget edit box -->
<!-- widget content -->
<div class="widget-body no-padding">
<!-- Success states for elements -->
<form class="smart-form">
<header>Success states for elements</header>
<fieldset>
<section>
<label class="label">Text input</label>
<label class="input state-success">
<input type="text">
</label>
<div class="note note-success">This is a required field.</div>
</section>
<section>
<label class="label">File input</label>
<div class="input input-file state-success">
<span class="button"><input type="file" id="file" onchange="this.parentNode.nextSibling.value = this.value">Browse</span><input type="text" readonly>
</div>
<div class="note note-success">This is a required field.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Select</label>
<label class="select state-success">
<select>
<option value="0">Choose name</option>
<option value="1">Alexandra</option>
<option value="2">Alice</option>
<option value="3" selected>Anastasia</option>
<option value="4">Avelina</option>
</select>
<i></i>
</label>
<div class="note note-success">Thanks for your selection.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Textarea</label>
<label class="textarea state-success">
<textarea rows="3"></textarea>
</label>
<div class="note note-success">Thanks for your text.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Radios</label>
<div class="row">
<div class="col col-4">
<label class="radio state-success"><input type="radio" name="radio"><i></i>Alexandra</label>
<label class="radio state-success"><input type="radio" name="radio"><i></i>Alice</label>
</div>
<div class="col col-4">
<label class="radio state-success"><input type="radio" name="radio" checked><i></i>Avelina</label>
<label class="radio state-success"><input type="radio" name="radio"><i></i>Basilia</label>
</div>
<div class="col col-4">
<label class="radio state-success"><input type="radio" name="radio"><i></i>Cassandra</label>
<label class="radio state-success"><input type="radio" name="radio"><i></i>Clemencia</label>
</div>
</div>
<div class="note note-success">Thanks for your selection.</div>
</section>
</fieldset>
<fieldset>
<section>
<label class="label">Checkboxes</label>
<div class="row">
<div class="col col-4">
<label class="checkbox state-success"><input type="checkbox" name="checkbox"><i></i>Alexandra</label>
<label class="checkbox state-success"><input type="checkbox" name="checkbox" checked><i></i>Alice</label>
</div>
<div class="col col-4">
<label class="checkbox state-success"><input type="checkbox" name="checkbox"><i></i>Avelina</label>
<label class="checkbox state-success"><input type="checkbox" name="checkbox"><i></i>Basilia</label>
</div>
<div class="col col-4">
<label class="checkbox state-success"><input type="checkbox" name="checkbox" checked><i></i>Cassandra</label>
<label class="checkbox state-success"><input type="checkbox" name="checkbox"><i></i>Clemencia</label>
</div>
</div>
<div class="note note-success">Thanks for your selection.</div>
</section>
</fieldset>
<fieldset>
<div class="row">
<section class="col col-5">
<label class="label">Toggles based on radios</label>
<label class="toggle state-success"><input type="radio" name="radio-toggle" checked><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Alexandra</label>
<label class="toggle state-success"><input type="radio" name="radio-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Anastasia</label>
<label class="toggle state-success"><input type="radio" name="radio-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Avelina</label>
<div class="note note-success">Thanks for your selection.</div>
</section>
<div class="col col-2"></div>
<section class="col col-5">
<label class="label">Toggles based on checkboxes</label>
<label class="toggle state-success"><input type="checkbox" name="checkbox-toggle" checked><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Cassandra</label>
<label class="toggle state-success"><input type="checkbox" name="checkbox-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Clemencia</label>
<label class="toggle state-success"><input type="checkbox" name="checkbox-toggle"><i data-swchon-text="ON" data-swchoff-text="OFF"></i>Desiderata</label>
<div class="note note-success">Thanks for your selection.</div>
</section>
</div>
</fieldset>
<footer>
<button type="submit" class="btn btn-primary">Submit</button>
<button type="button" class="btn btn-default" onclick="window.history.back();">Back</button>
</footer>
</form>
<!--/ Success states for elements -->
</div>
<!-- end widget content -->
</div>
<!-- end widget div -->
</div>
<!-- end widget -->
</article>
<!-- WIDGET END -->
</div>
<!-- end row -->
</section>
<!-- end widget grid -->
</div>
<!-- END MAIN CONTENT -->
</div>
<!-- END MAIN PANEL -->
<!-- ==========================CONTENT ENDS HERE ========================== -->
<?php
//include required scripts
include("inc/scripts.php");
?>
<!-- PAGE RELATED PLUGIN(S)
<script src="..."></script>-->
<script>
$(document).ready(function() {
// PAGE RELATED SCRIPTS
})
</script>
<?php
//include footer
include("inc/footer.php");
?>