File tree 3 files changed +41
-9
lines changed
3 files changed +41
-9
lines changed Original file line number Diff line number Diff line change 13
13
</ div >
14
14
< div >
15
15
< label > </ label >
16
- < input type ="text " data-allow ="onlyAlpha " name ="name2 ">
16
+ < input type ="text " data-allow ="onlyAlpha " name ="name2 " required >
17
17
</ div >
18
18
< div >
19
19
< label > </ label >
25
25
</ div >
26
26
</ form >
27
27
28
- < script src ="./../js/validatorNew.js "> </ script >
29
- <!--< script src="./../js/validatorNew.es6.js"></script>-- >
28
+ <!--< script src="./../js/validatorNew.js"></script>-- >
29
+ < script src ="./../js/validatorNew.es6.js "> </ script >
30
30
< script >
31
31
32
- // var form = new jsValidator().init({
33
- // form: 'form2submit',
34
- // forceFilter: true
35
- // });
36
-
37
- var form = jsValidator . init ( {
32
+ var form = new jsValidator ( ) . init ( {
38
33
form : 'form2submit' ,
39
34
forceFilter : true
40
35
} ) ;
41
36
37
+ // var form = jsValidator.init({
38
+ // form: 'form2submit',
39
+ // forceFilter: true
40
+ // });
41
+
42
42
</ script >
43
43
</ body >
44
44
</ html >
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ class jsValidator {
45
45
this . forceFilter = false ;
46
46
// To Filter the First load.
47
47
this . initialLoad = true ;
48
+ // Global options.
49
+ this . option = false ;
48
50
}
49
51
50
52
// Initiating the Validator.
@@ -53,6 +55,8 @@ class jsValidator {
53
55
54
56
jsLogger . table ( option ) ;
55
57
58
+ // To Update global options.
59
+ this . option = option ;
56
60
// Update "jsSettings" to global object.
57
61
this . jsSettings = new jsSettings ( ) . init ( option ) ;
58
62
// Update "jsForm" to global object.
@@ -85,6 +89,18 @@ class jsValidator {
85
89
}
86
90
}
87
91
92
+ // To update the DOM to make action listener.
93
+ update ( ) {
94
+ // To Update global options.
95
+ let option = this . option ;
96
+ // Update "jsSettings" to global object.
97
+ this . jsSettings = new jsSettings ( ) . init ( option ) ;
98
+ // Update "jsForm" to global object.
99
+ this . jsForm = new jsForm ( ) . init ( option ) ;
100
+ // Initiate form error setup.
101
+ this . jsFormError = new jsFormError ( ) . init ( ) ;
102
+ }
103
+
88
104
// To checking all elements from registered form.
89
105
check ( ) {
90
106
// Loading JS Form.
Original file line number Diff line number Diff line change @@ -41,10 +41,14 @@ var jsValidator = {
41
41
forceFilter : false ,
42
42
// To Filter the First load.
43
43
initialLoad : true ,
44
+ // Global options.
45
+ option : false ,
44
46
// Initiating the Validator.
45
47
init : function ( option ) {
46
48
jsLogger . table ( option ) ;
47
49
50
+ // To Update global options.
51
+ this . option = option ;
48
52
// Updating the filter flag to global.
49
53
this . onlyFilter = option . onlyFilter ;
50
54
// Update "jsSettings" to global object.
@@ -78,6 +82,18 @@ var jsValidator = {
78
82
} ) ;
79
83
}
80
84
} ,
85
+ // To Refresh the DOM and enable Dynamic-Elements to Access.
86
+ update : function ( ) {
87
+ var option = this . option ;
88
+ // Updating the filter flag to global.
89
+ this . onlyFilter = option . onlyFilter ;
90
+ // Update "jsSettings" to global object.
91
+ this . jsSettings = jsSettings . init ( option ) ;
92
+ // Update "jsForm" to global object.
93
+ this . jsForm = jsForm . init ( option ) ;
94
+ // Initiate form error setup.
95
+ this . jsFormError = jsFormError . init ( ) ;
96
+ } ,
81
97
// To checking all elements from registered form.
82
98
check : function ( ) {
83
99
var status = false ;
You can’t perform that action at this time.
0 commit comments