user3294091
user3294091

Reputation: 41

Angular JS form validatior

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.

link

Upvotes: 0

Views: 41

Answers (2)

Christian Phillips
Christian Phillips

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

squiroid
squiroid

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

Related Questions