Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/demo/index2.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>
<div>
<label></label>
<input type="text" data-allow="onlyAlpha" name="name2">
<input type="text" data-allow="onlyAlpha" name="name2" required>
</div>
<div>
<label></label>
Expand All @@ -25,20 +25,20 @@
</div>
</form>

<script src="./../js/validatorNew.js"></script>
<!--<script src="./../js/validatorNew.es6.js"></script>-->
<!--<script src="./../js/validatorNew.js"></script>-->
<script src="./../js/validatorNew.es6.js"></script>
<script>

// var form = new jsValidator().init({
// form: 'form2submit',
// forceFilter: true
// });

var form = jsValidator.init({
var form = new jsValidator().init({
form: 'form2submit',
forceFilter: true
});

// var form = jsValidator.init({
// form: 'form2submit',
// forceFilter: true
// });

</script>
</body>
</html>
16 changes: 16 additions & 0 deletions src/js/validatorNew.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
16 changes: 16 additions & 0 deletions src/js/validatorNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down