Skip to content

Commit d851622

Browse files
author
shankarThiyagaraajan
committed
- Declaration issue fixed.
1 parent 5093d4d commit d851622

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/demo/index3.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
</form>
9090
</div>
9191
<script src="./../js/multi_formValidator.js"></script>
92-
<!--<script src="../js/formValidator.es6.min.js"></script>-->
9392

9493
<script>
9594

src/js/formValidator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ var jsValidator = {
184184
// Apply filter for Email elements.
185185
if (activeElem.type == 'email') jsFilter.email(activeElem);
186186
// Apply filter for Numeric elements.
187-
// if (activeElem.min || activeElem.max || activeElem.minLength || activeElem.maxLength) jsFilter.limit(activeElem);
187+
if (activeElem.min || activeElem.max || activeElem.minLength || activeElem.maxLength) jsFilter.limit(activeElem);
188188
// Apply filter File elements.
189189
if (activeElem.type == 'file') jsFilter.file(activeElem);
190190
// Apply filter with string, alphaNumeric and pregMatch.

src/js/multi_formValidator.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Author : Shankar Thiyagaraajan
66
* Email : shankarthiyagaraajan@gmail.com
7-
* Github : https://github.com/shankarThiyagaraajan
7+
* GitHub : https://github.com/shankarThiyagaraajan
88
*
99
* Source
1010
* https://github.com/global-source/javascript_form_validator
@@ -139,7 +139,7 @@ function jsValidator() {
139139
}
140140
}
141141
}
142-
if (false == this.initialLoad) validationResponse.init(errorList, this.option);
142+
if (false == this.initialLoad) new validationResponse().init(errorList, this.option);
143143
this.initialLoad = false;
144144
helper.scrollToError();
145145
return status;
@@ -205,6 +205,7 @@ function jsValidator() {
205205
// jsLogger.out('Quick', event);
206206
var log = [];
207207
var target = event.target;
208+
// To check the validation of an element.
208209
log = new jsRuleSets().checkValidation(target, log);
209210
// jsLogger.out('Quick Out', log);
210211
new validationResponse().process(log);
@@ -832,6 +833,12 @@ var helper = {
832833
scrollToError: function () {
833834
var dummy_id = '__header_error_target_temp';
834835
var active_class = new validationResponse().getClass();
836+
837+
if (false === active_class) {
838+
jsLogger.out('Active Class Error', 'ACTIVE CLASS NOT DEFINED, GET :' + active_class);
839+
return false;
840+
}
841+
835842
if (0 === document.getElementsByClassName(active_class).length) return false;
836843
// Getting current ID of the element.
837844
var active_id = document.getElementsByClassName(active_class)[0].id;

0 commit comments

Comments
 (0)