|
4 | 4 | * |
5 | 5 | * Author : Shankar Thiyagaraajan |
6 | 6 | * Email : shankarthiyagaraajan@gmail.com |
7 | | - * Github : https://github.com/shankarThiyagaraajan |
| 7 | + * GitHub : https://github.com/shankarThiyagaraajan |
8 | 8 | * |
9 | 9 | * Source |
10 | 10 | * https://github.com/global-source/javascript_form_validator |
@@ -139,7 +139,7 @@ function jsValidator() { |
139 | 139 | } |
140 | 140 | } |
141 | 141 | } |
142 | | - if (false == this.initialLoad) validationResponse.init(errorList, this.option); |
| 142 | + if (false == this.initialLoad) new validationResponse().init(errorList, this.option); |
143 | 143 | this.initialLoad = false; |
144 | 144 | helper.scrollToError(); |
145 | 145 | return status; |
@@ -205,6 +205,7 @@ function jsValidator() { |
205 | 205 | // jsLogger.out('Quick', event); |
206 | 206 | var log = []; |
207 | 207 | var target = event.target; |
| 208 | + // To check the validation of an element. |
208 | 209 | log = new jsRuleSets().checkValidation(target, log); |
209 | 210 | // jsLogger.out('Quick Out', log); |
210 | 211 | new validationResponse().process(log); |
@@ -832,6 +833,12 @@ var helper = { |
832 | 833 | scrollToError: function () { |
833 | 834 | var dummy_id = '__header_error_target_temp'; |
834 | 835 | 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 | + |
835 | 842 | if (0 === document.getElementsByClassName(active_class).length) return false; |
836 | 843 | // Getting current ID of the element. |
837 | 844 | var active_id = document.getElementsByClassName(active_class)[0].id; |
|
0 commit comments