From e654f2614b0e177cfc0be674805d3f0cbc55c50b Mon Sep 17 00:00:00 2001 From: shankar Date: Wed, 3 May 2017 08:36:06 +0530 Subject: [PATCH 1/2] - Dynamic Element Access (Core - Javascript) Implementation. --- src/js/validatorNew.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/js/validatorNew.js b/src/js/validatorNew.js index 45a705c..f6968d9 100644 --- a/src/js/validatorNew.js +++ b/src/js/validatorNew.js @@ -41,10 +41,14 @@ var jsValidator = { forceFilter: false, // To Filter the First load. initialLoad: true, + // Global options. + option: false, // Initiating the Validator. init: function (option) { jsLogger.table(option); + // To Update global options. + this.option = option; // Updating the filter flag to global. this.onlyFilter = option.onlyFilter; // Update "jsSettings" to global object. @@ -78,6 +82,18 @@ var jsValidator = { }); } }, + // To Refresh the DOM and enable Dynamic-Elements to Access. + update: function () { + var option = this.option; + // Updating the filter flag to global. + this.onlyFilter = option.onlyFilter; + // Update "jsSettings" to global object. + this.jsSettings = jsSettings.init(option); + // Update "jsForm" to global object. + this.jsForm = jsForm.init(option); + // Initiate form error setup. + this.jsFormError = jsFormError.init(); + }, // To checking all elements from registered form. check: function () { var status = false; From 796d27c75cd099dee0da75bc6ba2f89684e7e40d Mon Sep 17 00:00:00 2001 From: shankar Date: Wed, 3 May 2017 21:31:51 +0530 Subject: [PATCH 2/2] - Dynamic Element Access (ES6) Implementation. --- src/demo/index2.html | 18 +++++++++--------- src/js/validatorNew.es6.js | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/demo/index2.html b/src/demo/index2.html index 762e1f2..c4f67be 100644 --- a/src/demo/index2.html +++ b/src/demo/index2.html @@ -13,7 +13,7 @@
- +
@@ -25,20 +25,20 @@
- - + + \ No newline at end of file diff --git a/src/js/validatorNew.es6.js b/src/js/validatorNew.es6.js index 86a97dd..c307592 100644 --- a/src/js/validatorNew.es6.js +++ b/src/js/validatorNew.es6.js @@ -45,6 +45,8 @@ class jsValidator { this.forceFilter = false; // To Filter the First load. this.initialLoad = true; + // Global options. + this.option = false; } // Initiating the Validator. @@ -53,6 +55,8 @@ class jsValidator { jsLogger.table(option); + // To Update global options. + this.option = option; // Update "jsSettings" to global object. this.jsSettings = new jsSettings().init(option); // Update "jsForm" to global object. @@ -85,6 +89,18 @@ class jsValidator { } } + // To update the DOM to make action listener. + update() { + // To Update global options. + let option = this.option; + // Update "jsSettings" to global object. + this.jsSettings = new jsSettings().init(option); + // Update "jsForm" to global object. + this.jsForm = new jsForm().init(option); + // Initiate form error setup. + this.jsFormError = new jsFormError().init(); + } + // To checking all elements from registered form. check() { // Loading JS Form.