Skip to content

Commit

Permalink
Merge pull request #5 from swatijadhav/master
Browse files Browse the repository at this point in the history
fixed required validation for textarea
  • Loading branch information
bakura10 committed Dec 9, 2014
2 parents b26936d + 4bc7174 commit 7082a1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addon/mixins/validatable-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ export default Ember.Mixin.create({
return;
}

// Validate Textarea with proper text and not accept only blank spaces, only new line characters.
if(input.tagName.toLowerCase() === 'textarea') {
var content = Ember.$.trim(Ember.$(input).val());
if(content.length === 0) {
Ember.$(input).val('');
}
}

if (!input.validity.valid && !input.validity.customError) {
this.set('errorMessage', this.getErrorMessage());
} else {
Expand Down

0 comments on commit 7082a1a

Please sign in to comment.