Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Form elements are not revalidated if not touched after a reset #1605

Closed
anthony-foulfoin opened this issue Nov 24, 2014 · 4 comments
Closed

Comments

@anthony-foulfoin
Copy link

For instance :

    <form role="form" name="form" novalidate>
        <input type="text" ng-required="true" ng-model="inputValue">
        <button type="reset">reset</button>
        <button type="submit" ng-click="submit()" ng-disabled="form.invalid">submit</button>
    </form>
  • The input is required and is firstly invalid.
  • If we fill it, it becomes valid
  • Then, we reset the form, the input becomes empty
  • The input becames valid while it is not
  • We can submit the form while it sould not be allowed

Expected result : when the form is resetted, the validators should be reevaluated and the input should be flagged as invalid

@naomiblack
Copy link
Contributor

@matsko this seems like a bug in Forms. Can you take a look please, and assess whether we could fix in 1.1?

@matsko
Copy link
Contributor

matsko commented Jan 12, 2015

@Tony75 this PR should fix this: #1637

Perhaps this may fix the other reset() related issue?

@anthony-foulfoin
Copy link
Author

@matsko thanks, your test case seems good :)

@matsko
Copy link
Contributor

matsko commented Jan 13, 2015

@Tony75 awesome. I'm closing this issue for now. Please correct me if the issue is still a problem.

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

Successfully merging a pull request may close this issue.

3 participants