0

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

2 Answers 2

2
 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/

Sign up to request clarification or add additional context in comments.

Comments

1

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 &&

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.