fix reset textarea & validateAll
This commit is contained in:
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
2
js/out/jquery.idealforms.min.js
vendored
2
js/out/jquery.idealforms.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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); });
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue