This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
CheckFormValidity was not working in all cases, there was a problem inside the function `getElementParentForm( )` which was returning null very often. This is due to the fact that `.form` only works with `input` element and so if user had validation on let say a `<div>` or any other Angular element that isn't an input then the `getElementParentForm( )` was returning null which was in turn making the `checkFormValidity($scope.formName)` and `$validationSummary` not working correctly.
- Loading branch information
1 parent
bd3dd6e
commit 032c5ff
Showing
11 changed files
with
153 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
var myApp = angular.module('myApp', ['ghiscoding.validation', 'pascalprecht.translate', 'ngTagsInput', 'angularjs-dropdown-multiselect', | ||
'hljs', 'isteven-multi-select']); | ||
|
||
myApp.config(['$compileProvider', function ($compileProvider) { | ||
$compileProvider.debugInfoEnabled(false); | ||
}]) | ||
.config(['$translateProvider', function ($translateProvider) { | ||
$translateProvider.useStaticFilesLoader({ | ||
prefix: 'https://rawgit.com/ghiscoding/angular-validation/master/locales/validation/', | ||
suffix: '.json' | ||
}); | ||
// load English ('en') table on startup | ||
$translateProvider.preferredLanguage('en').fallbackLanguage('en'); | ||
}]); | ||
|
||
myApp.controller('Ctrl', ['$scope','ValidationService', function ($scope,ValidationService) { | ||
|
||
|
||
var validationService = new ValidationService({ scope: $scope, isolatedScope: $scope }); | ||
|
||
$scope.select1model = []; | ||
$scope.select1data = [ | ||
{id: 1, label: "Joe"}, | ||
{id: 2, label: "John"}, | ||
{id: 3, label: "Jane"} | ||
]; | ||
|
||
$scope.submit = function () { | ||
if (validationService.checkFormValidity($scope.test)) { | ||
alert('valid'); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="myApp" ng-strict-di ng-cloak=""> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Angular-Validation Example with Interpolation</title> | ||
<link rel="stylesheet" href="../../style.css"> | ||
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="http://mbenford.github.io/ngTagsInput/css/ng-tags-input.min.css" /> | ||
<link rel="stylesheet" href="http://isteven.github.io/angular-multi-select/css/isteven-multi-select.css"> | ||
</head> | ||
|
||
<body ng-controller="Ctrl as vm"> | ||
<div class="container"> | ||
<form name="test"> | ||
<div class="form-group"> | ||
<label> | ||
Dropdown MultiSelect | ||
</label> | ||
<div name="select1" | ||
ng-dropdown-multiselect="" | ||
options="select1data" | ||
selected-model="select1model" | ||
ng-model="select1model" | ||
extra-settings="{externalIdProp: ''}" | ||
validation="required" validation-array-objprop="label"> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label> | ||
Textbox | ||
</label> | ||
<input class="form-control" type="text" name="nametest" ng-model="myTextbox" validation="required"> | ||
</div> | ||
</form> | ||
<hr /> | ||
<div class="form-actions"> | ||
<button type="submit" name="save_btn" class="btn btn-primary" ng-click="submit()">{{ 'SAVE' | translate }}</button> | ||
</div> | ||
</div> | ||
|
||
<!-- external librairies CDN --> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"></script> | ||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.js"></script> | ||
|
||
<!-- angular-translate --> | ||
<!-- Visit Angular-Translate https://github.com/PascalPrecht/angular-translate --> | ||
<script src="../../vendors/angular-translate/angular-translate.min.js"></script> | ||
<script src="../../vendors/angular-translate/angular-translate-loader-static-files.min.js"></script> | ||
|
||
<!-- ngTagsInput --> | ||
<script src="http://mbenford.github.io/ngTagsInput/js/ng-tags-input.min.js"></script> | ||
|
||
<!-- AngularJS Dropdown MultiSelect --> | ||
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script> | ||
<script type="text/javascript" src="https://rawgit.com/pc035860/angular-highlightjs/master/angular-highlightjs.js"></script> | ||
<script src="https://rawgit.com/dotansimha/angularjs-dropdown-multiselect/master/src/angularjs-dropdown-multiselect.js"></script> | ||
|
||
<!-- AngularJS Multi-Select --> | ||
<script src="https://rawgit.com/isteven/angular-multi-select/master/isteven-multi-select.js"></script> | ||
|
||
<!-- Angular-Validation --> | ||
<script type="text/javascript" src="../../dist/angular-validation.min.js"></script> | ||
<!-- | ||
<script type="text/javascript" src="../../src/validation-directive.js"></script> | ||
<script type="text/javascript" src="../../src/validation-service.js"></script> | ||
<script type="text/javascript" src="../../src/validation-common.js"></script> | ||
<script type="text/javascript" src="../../src/validation-rules.js"></script> | ||
--> | ||
|
||
<!-- my application --> | ||
<script type="text/javascript" src="app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters