Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <uib-tab index="5" heading="{{tabs[5].title}}" select="changeCheck($event)">
  2. <ng-form name="{{tabs[5].form}}">
  3. <div class="col-md-9">
  4. ...
  5. <div class="col-md-6">
  6. <h4>Add Followup</h4>
  7. <div class="form-group">
  8. <label for="addFollowupDate" class="control-label">Date:</label>
  9. <div class="input-group">
  10. <input type="text" id="addFollowupDate"
  11. class="form-control"
  12. uib-datepicker-popup="{{format}}"
  13. ng-required="true"
  14. ng-model="newFollowup.date"
  15. is-open="addFollowupPopup.opened"
  16. datepicker-options="dateOptions"
  17. close-text="Close"
  18. alt-input-formats="altInputFormats" />
  19. <span class="input-group-btn">
  20. <button type="button" class="btn btn-default" ng-click="openAddFollowupPopup()"><i class="fa fa-calendar"></i></button>
  21. </span>
  22. <div class="help-block" ng-messages="followupsForm.newFollowup.date.$error" ng-if="followupsForm.newFollowup.date.$invalid && followupsForm.newFollowup.date.$touched">
  23. <div ng-message="required">This field is required</div>
  24. </div>
  25. </div>
  26. </div>
  27.  
  28. $scope.followupsForm = $('ng-form[name="followupsForm"]').data('$formController');
  29.  
  30. if ($scope.followupsForm.$invalid) {
  31.  
  32. angular.forEach($scope.followupsForm.$error, function (formErrorField) {
  33. angular.forEach(formErrorField, function (errorField) {
  34. errorField.$setTouched(); // by setting to touched, the relevant message will display if the field is invalid.
  35. });
  36. });
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement