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

Commit 220c453

Browse files
committed
Fix issue #56 - TextArea validation with ENTER key
1 parent 113eb95 commit 220c453

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": [

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Angular-Validation change logs
22

3+
1.4.1 (2015-08-09) Fixed issue #55 - TextArea validation problem with ENTER key (newline).
34
1.4.0 (2015-08-06) Tested with AngularJS 1.4.x branch. Also fixed issue #55 - ui bootsrap datepicker and angular-validation.
45
1.3.39 (2015-07-28) Fixed issue #54 - display alt text as HTML instead of escaped text, changed from `.text()` to `.html()`
56
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`).

dist/angular-validation.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-ghiscoding",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"author": "Ghislain B.",
55
"description": "Angular-Validation Directive and Service (ghiscoding)",
66
"main": "app.js",

protractor/full_tests_spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function loadData() {
235235
'aliases': ['between_len'],
236236
'params': '1,5',
237237
'invalid_data': ['123456', 'abcdefg', '1234567890'],
238-
'valid_data': ['12345', 'abcde', '!@#$%'],
238+
'valid_data': ['12345', 'abcde', '!@#$%', '1\r234'],
239239
'error_message': {
240240
'en': "Text must be between 1 and 5 characters in length.",
241241
'es': "El número de caracteres debe de estar entre 1 y 5.",
@@ -677,7 +677,7 @@ function loadData() {
677677
'aliases': ['max_len'],
678678
'params': '11',
679679
'invalid_data': ['123456789012', 'abcdefghijkl', 'abcdefghijklmnopqrstuvwxyz'],
680-
'valid_data': ['1234567890', '12345678901', 'abcdefghijk'],
680+
'valid_data': ['1234567890', '12345678901', 'abcdefghijk', '12345\r67890'],
681681
'error_message': {
682682
'en': "May not be greater than 11 characters.",
683683
'es': "No puede contener mas de 11 caracteres.",
@@ -705,7 +705,7 @@ function loadData() {
705705
'aliases': ['min_len'],
706706
'params': '3',
707707
'invalid_data': ['12', 'ab'],
708-
'valid_data': ['123', 'abc', 'word'],
708+
'valid_data': ['123', 'abc', 'word', '1\r23'],
709709
'error_message': {
710710
'en': "Must be at least 3 characters.",
711711
'es': "Debe contener almenos 3 caracteres.",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Angular Validation (Directive / Service)
2-
`Version: 1.4.0`
2+
`Version: 1.4.1`
33
### Form validation after user inactivity of default 1sec. (customizable timeout)
44

55
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!

src/validation-rules.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ angular
9191
throw "This validation must include exactly 2 params separated by a comma (,) ex.: between_len:1,5";
9292
}
9393
validator = {
94-
pattern: "^.{" + ranges[0] + "," + ranges[1] + "}$",
94+
pattern: "^(.|[\r\n]){" + ranges[0] + "," + ranges[1] + "}$",
9595
message: "INVALID_BETWEEN_CHAR",
9696
params: [ranges[0], ranges[1]],
9797
type: "regex"
@@ -399,7 +399,7 @@ angular
399399
case "exactLen" :
400400
case "exact_len" :
401401
validator = {
402-
pattern: "^.{" + ruleParams + "}$",
402+
pattern: "^(.|[\r\n]){" + ruleParams + "}$",
403403
message: "INVALID_EXACT_LEN",
404404
params: [ruleParams],
405405
type: "regex"
@@ -470,7 +470,7 @@ angular
470470
case "maxLen" :
471471
case "max_len" :
472472
validator = {
473-
pattern: "^.{0," + ruleParams + "}$",
473+
pattern: "^(.|[\r\n]){0," + ruleParams + "}$",
474474
message: "INVALID_MAX_CHAR",
475475
params: [ruleParams],
476476
type: "regex"
@@ -488,7 +488,7 @@ angular
488488
case "minLen" :
489489
case "min_len" :
490490
validator = {
491-
pattern: "^.{" + ruleParams + ",}$",
491+
pattern: "^(.|[\r\n]){" + ruleParams + ",}$",
492492
message: "INVALID_MIN_CHAR",
493493
params: [ruleParams],
494494
type: "regex"

0 commit comments

Comments
 (0)