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

validationValue called when displaying the form #59

Open
steph643 opened this issue Apr 10, 2015 · 1 comment
Open

validationValue called when displaying the form #59

steph643 opened this issue Apr 10, 2015 · 1 comment

Comments

@steph643
Copy link

Unless I missed something, the validationValue function is called on elements when:

  • the form is displayed
  • a validationEvent occurs

So in the doc:

// This is an optional method that lets you hook into the validation event

should be more:

// This is an optional method that lets you hook into the validation process, which occurs at form startup and upon a validation event

My second remark is that I need to distinguish between the startup call and the other ones. The reason is that I perform async validation and I don't want this to occur at startup time, because it takes time and I am sure my initial data is correct.

Did you think about that? Are you sure validating at startup is required? If it is, maybe there could be a template argument saying "please don't validate at startup"? Or a validationValue boolean argument saying "this call is the startup call"?

While we discuss this, can you think of a workaround to detect the startup call inside validationValue?

@ramijarrar
Copy link
Contributor

I definitely support getting rid of the validation on startup, in most cases it is just a burden. We can support this behavior more elegantly with a method on the form block to validate containing elements that can run be manually on startup (or whenever else we need to validate).

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

No branches or pull requests

3 participants