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

Commit 24037e4

Browse files
committed
Fixed #23 - $validationSummary problems 2+ forms
Fixed #23 - If multiple forms exist in the app the errors in 1 form affect validation in the other
1 parent 1c67eb8 commit 24037e4

File tree

13 files changed

+144
-21
lines changed

13 files changed

+144
-21
lines changed

app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ myApp.config(['$compileProvider', '$locationProvider', '$routeProvider', functio
99
templateUrl: 'templates/testingFormDirective.html',
1010
controller: 'CtrlValidationDirective'
1111
})
12+
.when('/validate-2forms', {
13+
templateUrl: 'templates/testing2Forms.html',
14+
controller: 'Ctrl2forms'
15+
})
1216
.when('/validate-service', {
1317
templateUrl: 'templates/testingFormService.html',
1418
controller: 'CtrlValidationService'
@@ -54,6 +58,17 @@ myApp.controller('CtrlValidationDirective', ['$scope', 'validationService', func
5458
}
5559
}]);
5660

61+
myApp.controller('Ctrl2forms', ['$scope', 'validationService', function ($scope, validationService) {
62+
$scope.submitForm = function() {
63+
if(new validationService().checkFormValidity($scope.form01)) {
64+
alert('All good, proceed with submit...');
65+
}
66+
}
67+
$scope.showValidationSummary = function () {
68+
$scope.displayValidationSummary = true;
69+
}
70+
}]);
71+
5772
// -- Controller to use Angular-Validation Service
5873
// -----------------------------------------------
5974

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ghiscoding.angular-validation",
3-
"version": "1.3.14",
3+
"version": "1.3.15",
44
"authors": [
55
"Ghislain B."
66
],

changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ Angular-Validation change logs
1515
1.3.11 (2015-03-30): Accepted pull request #15 to fix form without name attribute. Also accepted pull request #18 to add Spanish locales.
1616
1.3.12 (2015-04-04): Fix issue #16 and added Validators Alternate Text option on all type of validators. Also fixed removeValidator and clean a lot of code.
1717
1.3.13 (2015-04-06) Fixed $translate delay issue when using external JSON files
18-
1.3.14 (2015-04-07) Merge pull request #19 Added norwegian translation and changes to allow user to remove invalid validators.
18+
1.3.14 (2015-04-07) Merge pull request #19 Added norwegian translation and changes to allow user to remove invalid validators.
19+
1.3.15 (2015-04-08) Fixed #23 If multiple forms exist in the app the errors in 1 form affect validation in the other

dist/angular-validation.min.js

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

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ <h1>Angular-Validation Directive|Service (ghiscoding)</h1>
2727
<div class="btn-group btn-group-sm">
2828
<button type="button" class="btn btn-default" ng-click="goto('/validate-directive')">Directive</button>
2929
<button type="button" class="btn btn-default" ng-click="goto('/validate-service')">Service</button>
30+
<button type="button" class="btn btn-default" ng-click="goto('/validate-2forms')">2 Forms</button>
3031
</div>
3132

3233
<br/><hr/>

locales/validation/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"INVALID_REQUIRED": "Field is required. ",
5252
"INVALID_URL": "Must be a valid URL. ",
5353
"INVALID_TIME": "Must be a valid time format (hh:mm) OR (hh:mm:ss). ",
54-
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected",
54+
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected. ",
5555

5656
"AREA1": "TextArea: Alphanumeric + Minimum(15) + Required",
5757
"ERRORS": "Errors",

locales/validation/es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"INVALID_REQUIRED": "El campo es requerido. ",
5252
"INVALID_URL": "Debe contener una dirección URL valida. ",
5353
"INVALID_TIME": "Debe contener un formato de tiempo valido (hh:mm) ó (hh:mm:ss). ",
54-
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected",
54+
"INVALID_CHECKBOX_SELECTED": "Casilla de verificación debe ser seleccionado. ",
5555

5656
"AREA1": "Area de texto: Alfanúmerica + Minimo(15) + Requerido",
5757
"ERRORS": "Errores",

locales/validation/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"INVALID_REQUIRED": "Le champ est requis. ",
5252
"INVALID_URL": "Doit être un URL valide. ",
5353
"INVALID_TIME": "Doit être un format de date valide (hh:mm) OU (hh:mm:ss). ",
54-
"INVALID_CHECKBOX_SELECTED": "Checkbox must be selected",
54+
"INVALID_CHECKBOX_SELECTED": "La case à cocher doit être sélectionnée. ",
5555

5656
"AREA1": "TextArea: Alphanumérique + Minimum(15) + Required",
5757
"ERRORS": "Erreurs",

package.json

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

readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Angular Validation (Directive / Service)
2-
`Version: 1.3.14`
2+
`Version: 1.3.15`
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!
@@ -459,4 +459,5 @@ License
459459
* [1.3.11](https://github.com/ghiscoding/angular-validation/commit/e807584f0bcdf0f28ef2ef905b6bc4e890926ac1) `2015-03-30` Accepted pull request #15 to fix form without name attribute. Also accepted pull request #18 to add Spanish locales.
460460
* [1.3.12](https://github.com/ghiscoding/angular-validation/commit/0af82337a6961923e3b022a19660237d3e6f7184) `2015-04-04` Fix issue #16 and added Validators Alternate Text option on all type of validators. Also fixed removeValidator and clean a lot of code.
461461
* [1.3.13](https://github.com/ghiscoding/angular-validation/commit/d0440bdd7fc2816e03d28ad3a9c3bd7bee8ac519) `2015-04-06` Fixed $translate delay issue when using external JSON files
462-
* [1.3.14](https://github.com/ghiscoding/angular-validation/pull/19) `2015-04-07` Merge pull request #19 Added norwegian translation and changes to allow user to remove invalid validators
462+
* [1.3.14](https://github.com/ghiscoding/angular-validation/pull/19) `2015-04-07` Merge pull request #19 Added norwegian translation and changes to allow user to remove invalid validators
463+
* [1.3.15]() `2015-04-08` Fixed #23 If multiple forms exist in the app the errors in 1 form affect validation in the other

0 commit comments

Comments
 (0)