Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Result Is Ignored #38

Closed
jdaudier opened this issue Oct 1, 2016 · 0 comments
Closed

Validation Result Is Ignored #38

jdaudier opened this issue Oct 1, 2016 · 0 comments

Comments

@jdaudier
Copy link
Contributor

jdaudier commented Oct 1, 2016

With these changes, we can now refuse to add an item unless it passes validation. We could also display error messages if validation fails by binding the invalid event in modelEvents. You can see how we've set our fields to blank fields on the model and also in the ui hash. If we start having more and more fields, you can see how this would quickly become unmanageable. Surely we can just clear the form when the model is cleared?

Validation Result Is Ignored

You provided the validation function in model, but in driver.js, you still add the model anyway, regardless of the validation outcome. I think you should wrap the last 2 lines inside onAddTodoItem() inside an if statement, such as if (this.model.validationError === null)

Submitted by @charliegdev

scott-w pushed a commit to scott-w/guides that referenced this issue Oct 1, 2016
@scott-w scott-w mentioned this issue Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant