Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Fix issue #56 - TextArea validation with ENTER key
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Aug 9, 2015
1 parent 113eb95 commit 220c453
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.4.0",
"version": "1.4.1",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": [
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Angular-Validation change logs

1.4.1 (2015-08-09) Fixed issue #55 - TextArea validation problem with ENTER key (newline).
1.4.0 (2015-08-06) Tested with AngularJS 1.4.x branch. Also fixed issue #55 - ui bootsrap datepicker and angular-validation.
1.3.39 (2015-07-28) Fixed issue #54 - display alt text as HTML instead of escaped text, changed from `.text()` to `.html()`
1.3.38 (2015-07-28) Fixed issue #52 - Changed default behavior of `ngDisabled` which was displaying error message right after an element became enabled, it will still pre-validate but not directly show the error message unless `preValidateFormElements` is set to True. Fixed issue #53 - To support `ngIf` (add a trigger on element `$destroy`).
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-ghiscoding",
"version": "1.4.0",
"version": "1.4.1",
"author": "Ghislain B.",
"description": "Angular-Validation Directive and Service (ghiscoding)",
"main": "app.js",
Expand Down
6 changes: 3 additions & 3 deletions protractor/full_tests_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function loadData() {
'aliases': ['between_len'],
'params': '1,5',
'invalid_data': ['123456', 'abcdefg', '1234567890'],
'valid_data': ['12345', 'abcde', '!@#$%'],
'valid_data': ['12345', 'abcde', '!@#$%', '1\r234'],
'error_message': {
'en': "Text must be between 1 and 5 characters in length.",
'es': "El número de caracteres debe de estar entre 1 y 5.",
Expand Down Expand Up @@ -677,7 +677,7 @@ function loadData() {
'aliases': ['max_len'],
'params': '11',
'invalid_data': ['123456789012', 'abcdefghijkl', 'abcdefghijklmnopqrstuvwxyz'],
'valid_data': ['1234567890', '12345678901', 'abcdefghijk'],
'valid_data': ['1234567890', '12345678901', 'abcdefghijk', '12345\r67890'],
'error_message': {
'en': "May not be greater than 11 characters.",
'es': "No puede contener mas de 11 caracteres.",
Expand Down Expand Up @@ -705,7 +705,7 @@ function loadData() {
'aliases': ['min_len'],
'params': '3',
'invalid_data': ['12', 'ab'],
'valid_data': ['123', 'abc', 'word'],
'valid_data': ['123', 'abc', 'word', '1\r23'],
'error_message': {
'en': "Must be at least 3 characters.",
'es': "Debe contener almenos 3 caracteres.",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Angular Validation (Directive / Service)
`Version: 1.4.0`
`Version: 1.4.1`
### Form validation after user inactivity of default 1sec. (customizable timeout)

Forms Validation with Angular made easy! Angular-Validation is an angular directive/service with locales (languages) with a very simple approach of defining your `validation=""` directly within your element to validate (input, textarea, etc) and...that's it!!! The directive/service will take care of the rest!
Expand Down
8 changes: 4 additions & 4 deletions src/validation-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ angular
throw "This validation must include exactly 2 params separated by a comma (,) ex.: between_len:1,5";
}
validator = {
pattern: "^.{" + ranges[0] + "," + ranges[1] + "}$",
pattern: "^(.|[\r\n]){" + ranges[0] + "," + ranges[1] + "}$",
message: "INVALID_BETWEEN_CHAR",
params: [ranges[0], ranges[1]],
type: "regex"
Expand Down Expand Up @@ -399,7 +399,7 @@ angular
case "exactLen" :
case "exact_len" :
validator = {
pattern: "^.{" + ruleParams + "}$",
pattern: "^(.|[\r\n]){" + ruleParams + "}$",
message: "INVALID_EXACT_LEN",
params: [ruleParams],
type: "regex"
Expand Down Expand Up @@ -470,7 +470,7 @@ angular
case "maxLen" :
case "max_len" :
validator = {
pattern: "^.{0," + ruleParams + "}$",
pattern: "^(.|[\r\n]){0," + ruleParams + "}$",
message: "INVALID_MAX_CHAR",
params: [ruleParams],
type: "regex"
Expand All @@ -488,7 +488,7 @@ angular
case "minLen" :
case "min_len" :
validator = {
pattern: "^.{" + ruleParams + ",}$",
pattern: "^(.|[\r\n]){" + ruleParams + ",}$",
message: "INVALID_MIN_CHAR",
params: [ruleParams],
type: "regex"
Expand Down

0 comments on commit 220c453

Please sign in to comment.