Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

form stops on first validation error leaving $error in incorrect state #7924

Closed
nakhli opened this issue Jun 20, 2014 · 2 comments
Closed

form stops on first validation error leaving $error in incorrect state #7924

nakhli opened this issue Jun 20, 2014 · 2 comments

Comments

@nakhli
Copy link
Contributor

nakhli commented Jun 20, 2014

Hi angular folks!
I am messing with Angular 1.3.0-beta.13. Module form.

I have an email field in my form that is validated for both being not empty and a valid email. The code is as follows (see plunker here: http://plnkr.co/edit/etQYvORPfUXR059kcbUR?p=preview)

<form name="myForm" novalidate>
  <input type="email" name="email" ng-model="email" required>
  <span ng-show="myForm.email.$error.required">Missing Email</span> |
  <span ng-show="myForm.email.$error.email">Invalid Email</span>
  <pre>myForm.email.$error: {{  myForm.email.$error | json }}</pre>
</form>

When started, only the Missing Email message is shown, as expected. When I start typing in the input, both messages Missing Email and Invalid Email are shown even if the field is not empty. This is not expected.

Orignial stackoverflow question with screenshots: http://stackoverflow.com/questions/24332902/angular-form-stops-on-first-validation-error-leaving-error-in-incorrect-state

Thanks!

@caitp
Copy link
Contributor

caitp commented Jun 20, 2014

This is a duuuuplicate, #7849 --- please search the issue tracker for similar issues before submitting!

Anyways, lets carry on the discussion for this issue over there, alright? Thanks =)

@nakhli
Copy link
Contributor Author

nakhli commented Jun 21, 2014

oops @caitp sorry missed the dupe. Will join the discussion there. thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants