Reputation: 41
I have problem with validating form, I have this validation example which show errors only when in first input is invalid value, when in first field is valid value there are no error shown.
Upvotes: 0
Views: 41
Reputation: 18769
You seem to be using name
in all the checks...
<div class="error" ng-show="signup_form.name.$dirty &&
You need to change the actual reference, so email
would be...
<div class="error" ng-show="signup_form.email.$dirty &&
Upvotes: 1
Reputation: 14037
Instead of using signup_form.name.$dirty && signup_form.name.$invalid && signup_form.submitted
Use this :-
<div class="error"
ng-show="signup_form.email.$dirty && signup_form.email.$invalid && signup_form.submitted">
<div class="error"
ng-show="signup_form.username.$dirty && signup_form.username.$invalid && signup_form.submitted">
update:- http://jsbin.com/fajoreguxu/1/
Upvotes: 2