|
| 1 | +<!DOCTYPE html> |
| 2 | +<html ng-app="myApp" ng-strict-di ng-cloak=""> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <title>Angular-Validation with Custom Javascript function</title> |
| 6 | + <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> |
| 7 | + <link rel="stylesheet" href="../../style.css"> |
| 8 | + </head> |
| 9 | + |
| 10 | + <body> |
| 11 | + <div class="container"> |
| 12 | + <h2>Example of Angular-Validation with Custom Javascript function</h2> |
| 13 | + |
| 14 | + <div ng-controller="CtrlDirective as Location"> |
| 15 | + <div class="row"> |
| 16 | + <div> |
| 17 | + <form class="form-horizontal" name="locationForm" novalidate ng-model-options="{ updateOn: 'blur' }"> |
| 18 | + |
| 19 | + <section class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> |
| 20 | + <label class="labels" for="name">Name *</label> |
| 21 | + <input type="text" |
| 22 | + name="name" |
| 23 | + id="name" |
| 24 | + validation="required|max_len:50" |
| 25 | + debounce="0" |
| 26 | + ng-model="Location.mylocation.Name" |
| 27 | + class="form-control input-lg input-full" |
| 28 | + placeholder="Enter Location Name"> |
| 29 | + </section> |
| 30 | + <section class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> |
| 31 | + <label class="labels" for="name">Simple Input *</label> |
| 32 | + <input type="text" |
| 33 | + name="simple" |
| 34 | + id="simple" |
| 35 | + validation="required|max_len:50" |
| 36 | + debounce="0" |
| 37 | + ng-model="Location.mylocation.Simple" /> |
| 38 | + </section> |
| 39 | + </form> |
| 40 | + <h3>Control below NOT in a form, doesn't have problem</h3> |
| 41 | + <!--// NOT in form--> |
| 42 | + <section class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> |
| 43 | + <label class="labels" for="name2">Name2 *</label> |
| 44 | + <input type="text" |
| 45 | + name="name2" |
| 46 | + id="name2" |
| 47 | + validation="required:alt=Please Enter Name|max_len:50" |
| 48 | + debounce="0" |
| 49 | + ng-model="Location.mylocation.Name2" |
| 50 | + class="form-control input-lg input-full" |
| 51 | + placeholder="Enter Location Name"> |
| 52 | + </section> |
| 53 | + |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + |
| 59 | + <!-- external librairies CDN --> |
| 60 | + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js"></script> |
| 61 | + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-route.js"></script> |
| 62 | + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-sanitize.js"></script> |
| 63 | + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.js"></script> |
| 64 | + |
| 65 | + <!-- angular-translate --> |
| 66 | + <!-- Visit Angular-Translate https://github.com/PascalPrecht/angular-translate --> |
| 67 | + <script src="../../vendors/angular-translate/angular-translate.min.js"></script> |
| 68 | + <script src="../../vendors/angular-translate/angular-translate-loader-static-files.min.js"></script> |
| 69 | + |
| 70 | + <!-- IBAN external library --> |
| 71 | + <script src="../../vendors/iban/iban.js"></script> |
| 72 | + |
| 73 | + <!-- Angular-Validation --> |
| 74 | + <script type="text/javascript" src="../../dist/angular-validation.min.js"></script> |
| 75 | + <!-- |
| 76 | + <script type="text/javascript" src="../../src/validation-directive.js"></script> |
| 77 | + <script type="text/javascript" src="../../src/validation-service.js"></script> |
| 78 | + <script type="text/javascript" src="../../src/validation-common.js"></script> |
| 79 | + <script type="text/javascript" src="../../src/validation-rules.js"></script> |
| 80 | + --> |
| 81 | + |
| 82 | + <!-- my application --> |
| 83 | + <script type="text/javascript" src="app.js"></script> |
| 84 | + </body> |
| 85 | +</html> |
0 commit comments