Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="myForm">
- <div class="control-group"
- ng-class="{error: myForm.name.$invalid && myForm.name.$dirty}">
- <label>Name:</label>
- <input type="text" name="name" ng-model="user.name" required/>
- <span ng-show="myForm.name.$invalid && myForm.name.$dirty"
- class="help-inline">Name is required</span>
- <span ng-show="myForm.names.$valid && myForm.names.$dirty">Great!</span>
- </div>
- </form>
- <!-- example 1 -->
- <label for="input1">Simle Integer</label>
- <input type="text" validation="integer|required" ng-model="form1.input1" name="input1" />
- <span class="validation text-danger"></span>
- <!-- example 2 -->
- <label for="input2">Alphanumeric + Exact(3) + required</label>
- <input type="text" validation="alpha|exact_len:3|required" ng-model="form1.input2" name="input2" />
- <span class="validation text-danger"></span>
- <input type="text" validation="integer|required" typing-limit="5000" ng-model="form1.input1" name="input1" />
- <span class="validation text-danger"></span>
- <style type="text/css">
- .myForm input.ng-invalid.ng-dirty {
- background-color: #FA787E;
- }
- .myForm input.ng-valid.ng-dirty {
- background-color: #78FA89;
- }
- </style>
- <form xt-form novalidate>
- <input name="email" ng-model="modelVal" xt-validate required>
- <button type="submit">Submit</button>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement