0

i am using valdr (https://github.com/netceteragroup/valdr) to validate my form with Angular. Since it only shows feedback messages after the user has clicked into an input, i would also like to display them if the user clicks the submit button. Is there any way to do that or trigger the validation manually?

springs
  • 1
  • 2

1 Answers1

1

Here is a link which talks about your issue: https://github.com/netceteragroup/valdr/issues/63

The author has said to use $submitted flag https://docs.angularjs.org/api/ng/type/form.FormController

You would use something like this below to show your error messages on submit and not on when you come out of the input field.

<span class="help-inline" ng-show="submitted && 
            form.email.$error.email">Invalid email</span>
Thalaivar
  • 23,282
  • 5
  • 60
  • 71