Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. <form name="myForm">
  2. <div class="control-group"
  3. ng-class="{error: myForm.name.$invalid && myForm.name.$dirty}">
  4. <label>Name:</label>
  5. <input type="text" name="name" ng-model="user.name" required/>
  6. <span ng-show="myForm.name.$invalid && myForm.name.$dirty"
  7. class="help-inline">Name is required</span>
  8. <span ng-show="myForm.names.$valid && myForm.names.$dirty">Great!</span>
  9. </div>
  10. </form>
  11.  
  12. <!-- example 1 -->
  13. <label for="input1">Simle Integer</label>
  14. <input type="text" validation="integer|required" ng-model="form1.input1" name="input1" />
  15. <span class="validation text-danger"></span>
  16.  
  17. <!-- example 2 -->
  18. <label for="input2">Alphanumeric + Exact(3) + required</label>
  19. <input type="text" validation="alpha|exact_len:3|required" ng-model="form1.input2" name="input2" />
  20. <span class="validation text-danger"></span>
  21.  
  22. <input type="text" validation="integer|required" typing-limit="5000" ng-model="form1.input1" name="input1" />
  23. <span class="validation text-danger"></span>
  24.  
  25. <style type="text/css">
  26. .myForm input.ng-invalid.ng-dirty {
  27. background-color: #FA787E;
  28. }
  29.  
  30. .myForm input.ng-valid.ng-dirty {
  31. background-color: #78FA89;
  32. }
  33. </style>
  34.  
  35. <form xt-form novalidate>
  36. <input name="email" ng-model="modelVal" xt-validate required>
  37. <button type="submit">Submit</button>
  38. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement