Skip to content

Commit a313a1f

Browse files
- Minor developer comments
1 parent 5f08fe2 commit a313a1f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/js/validatorNew.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ var jsValidator = {
116116
if (false == this.initialLoad) validationResponse.init(errorList);
117117

118118
this.initialLoad = false;
119-
alert('Status ' + status);
120-
return false;
121-
// return status;
119+
120+
return status;
122121

123122
},
124123
// To looping all elements for actions.
@@ -326,6 +325,7 @@ var jsFilter = {
326325
isAlpha: function (event) {
327326
// To check is this action is from "windows" action or not.
328327
if (true === helper.isWindowAction(event)) return true;
328+
// Managing the Pattern.
329329
var status = pattern.validate(event, 'a-zA-Z');
330330
// Return status of the Action.
331331
if (false === status) event.preventDefault();
@@ -342,6 +342,7 @@ var jsFilter = {
342342
isValidPassword: function (event) {
343343
// Prevent using "space".
344344
var charCode = (event.which) ? event.which : event.keyCode;
345+
// If event is "space" then prevent to enter.
345346
if (charCode === 32) {
346347
event.preventDefault();
347348
return false;
@@ -487,6 +488,7 @@ var jsField = {
487488
// Return all required elements list.
488489
required: function (field, forceFilter) {
489490
var requiredFieldsList = [];
491+
// Looping fields to filter.
490492
for (var i = 0; i < field.length; i++) {
491493
// Check and push elements.
492494
if (field[i].required === true || true === forceFilter) {
@@ -505,6 +507,7 @@ var jsField = {
505507
var jsRuleSets = {
506508
// To Check, whether the element have value or not.
507509
isSet: function (elem) {
510+
// If field is not required, then return "true".
508511
if (false === elem.required) return true;
509512
var status = true;
510513
var value = elem.value;
@@ -514,6 +517,7 @@ var jsRuleSets = {
514517
},
515518
// To Check Element with Min Condition.
516519
min: function (elem) {
520+
// If field is not required, then return "true".
517521
if (false === elem.required) return true;
518522
var status = true;
519523
var value = elem.value;
@@ -524,6 +528,7 @@ var jsRuleSets = {
524528
},
525529
// To Check Element with Max Condition.
526530
max: function (elem) {
531+
// If field is not required, then return "true".
527532
if (false === elem.required) return true;
528533
var status = true;
529534
var value = elem.value;
@@ -534,6 +539,7 @@ var jsRuleSets = {
534539
},
535540
// To Check Element Email is Valid or Not.
536541
email: function (elem) {
542+
// If field is not required, then return "true".
537543
if (false === elem.required) return true;
538544
var status = true;
539545
var email = elem.value;
@@ -550,13 +556,15 @@ var jsRuleSets = {
550556
},
551557
// To Check Element Phone Value is Valid or Not.
552558
phone: function (elem, pattern) {
559+
// If field is not required, then return "true".
553560
if (false === elem.required) return true;
554561
var status = true;
555562
if (elem.value === '') status = false;
556563
return status;
557564
},
558565
// To Compare two Elements Values.
559566
compare: function (elem1) {
567+
// If field is not required, then return "true".
560568
if (false === elem1.required) return true;
561569
var elem2_id = elem1.getAttribute('data-check');
562570

0 commit comments

Comments
 (0)