Created
April 17, 2017 19:29
-
-
Save isaquealves/83432ff0a057fa77e6117e2d0729210e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Form = { | |
[...] | |
validate: function() { | |
var fields = this.form.querySelectorAll('input'); | |
var self = this; | |
fields.forEach(function(element) { | |
if (self.formFields.indexOf(element.name) !== -1) { | |
var allowed = self.formFields[element.name].allow; | |
self.invalid[element.name] = matchValues(element, allowed); | |
} | |
}); | |
return (!nulled(this.invalid)) ? true : false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment