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

Submited flag for the form property #276

Closed
kristian-puccio opened this issue Nov 14, 2015 · 5 comments
Closed

Submited flag for the form property #276

kristian-puccio opened this issue Nov 14, 2015 · 5 comments

Comments

@kristian-puccio
Copy link

What do you think about having a hasSubmitted flag added to the form prop?

At the moment on submission all the fields are being 'touched' which allows you to know whether to show validation for that field. A more fine grained approach would be to have the error label check for touched on the field or submitted on the form. That way it's up to the user if they want to use either or both or even display different message for each state.

If your into the idea I'll look into getting a pull request for you.

@erikras
Copy link
Member

erikras commented Nov 16, 2015

Okay, I can see the value in this. It should be a boolean called submitFailed, which will default to false, be set to false on a successful submit, and set to true on a failed submit, no matter the cause of the failure. Does that sound, okay?

Don't bother with the PR unless you really want to get grease on your hands. It'll be pretty trivial for me to add.

@erikras
Copy link
Member

erikras commented Nov 16, 2015

Available in v3.0.8.

@kristian-puccio
Copy link
Author

Awesome nice one! Thanks heaps

@oyeanuj
Copy link
Contributor

oyeanuj commented Dec 27, 2015

@kristian-puccio @erikras How do you determine if the submitFailed field above is false because the submission failed or because submission didn't happen? Is the idea to use touched for each or for a specific field in conjunction with submitFailed?

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants