Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <body ng-app="simpleValidationExample">
  2. <div ng-controller="MainCtrl">
  3. <h1>Simple ngMessages Validation Example</h1>
  4. <p>User will not be notified of errors untill a submit has been attempted on the form</p>
  5. <form name="simpleForm" ng-submit="processForm(simpleForm)" novalidate>
  6. <ul class="form" ng-class="{ 'form--submitAttempted' : submitAttempted }">
  7. <li class="form__row">
  8. <input class="form__input"
  9. type="text"
  10. placeholder="FIRST NAME"
  11. maxlength="30"
  12. name="fname"
  13. ng-model="firstname"
  14. required />
  15. <div ng-messages="simpleForm.fname.$error" class="form__error">
  16. <div ng-message="required">Required</div>
  17. </div>
  18. </li>
  19. <li class="form__row">
  20. <input type="email"
  21. class="form__input"
  22. placeholder="EMAIL"
  23. name="email"
  24. ng-model="emailAddr"
  25. required />
  26. <div ng-messages="simpleForm.email.$error" class="form__error">
  27. <div ng-message="required">Required</div>
  28. <div ng-message="email">Please enter a valid email address</div>
  29. </div>
  30. </li>
  31. <li class="form__row">
  32. <button class="form__input form__input--submit">SUBMIT</button>
  33. </li>
  34. </ul>
  35. </form>
  36. </div>
  37. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement