fix reset textarea & validateAll

This commit is contained in:
elclanrs 2014-06-10 08:01:07 -04:00
parent f35510b33b
commit b4bf793e86
5 changed files with 11 additions and 120 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -20,7 +20,7 @@ module.exports = {
this.addRules(this.opts.rules || {});
this.$form.submit(function(e) {
self._validateAll();
self._validateAll(true);
self.focusFirstInvalid();
self.opts.onSubmit.call(self, self.getInvalid().length, e);
});
@ -204,8 +204,8 @@ module.exports = {
return valid;
},
_validateAll: function() {
_validateAll: function(handleStyle, handleError) {
var self = this;
this.$inputs.each(function(){ self._validate(this, true); });
this.$inputs.each(function(){ self._validate(this, handleStyle, handleError); });
}
};

View file

@ -52,7 +52,7 @@ module.exports = {
if (name) $inputs = $inputs.filter('[name="'+ name +'"]');
$inputs.filter('input:not(:checkbox, :radio)').val('');
$inputs.filter('input:not(:checkbox, :radio), textarea').val('');
$inputs.filter(':checkbox, :radio').prop('checked', false);
$inputs.filter('select').find('option').prop('selected', function() {
return this.defaultSelected;