Skip to content

Commit

Permalink
Remove the need for passing in class or id selector to the validateFo…
Browse files Browse the repository at this point in the history
…rm function for simplicity
  • Loading branch information
Rob G authored and Rob G committed Aug 28, 2016
1 parent 7dda97c commit 763701e
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions simpleform.js
Expand Up @@ -133,12 +133,7 @@ THE SOFTWARE.
// manually created by the user which contains the validation.
// The function needs to return true on the validation
// for us to continue.
if (self.attr('id')) {
isFormValid = validateForm(self.attr('id'), self);
} else {
isFormValid = validateForm(self.attr('class'), self);
}

isFormValid = validateForm(self);

// If Validation was successful and the form isn't animating, continue.
if (isFormValid && !isAnimating()) {
Expand All @@ -160,12 +155,7 @@ THE SOFTWARE.
// Before moving forward, does the user have validation
// turned on?
if (params.validate) {

if (self.attr('id')) {
isFormValid = validateForm(self.attr('id'), self);
} else {
isFormValid = validateForm(self.attr('class'), self);
}
isFormValid = validateForm(self);
}

if (!isFormValid) e.preventDefault();
Expand Down

0 comments on commit 763701e

Please sign in to comment.