A way to keep backend errors with client validation
See original GitHub issueHere is a simple form with errors example:
name - no error
surname - no error
When I submit form, I receive backend errors: { surname: 'Exists' }
. So, I set field errors and now they are:
name - no error
surname - 'Exists'
Now, if I change or blur the value of the name
field, the whole form validation will be triggered and backend error will be erased for surname
field.
How is it possible to erase field’s backend error only if the value of that field was changed?
I can think of possible solution with using form’s status
to save backend errors, checking the field’s previous/new value, but it feels like a really big hack.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:45
- Comments:32 (15 by maintainers)
Top Results From Across the Web
Error Handling from backends to the frontend! - LinkedIn
Invalid Input. If the backend had an input validation, tell the user! Let them know some changes might succeed. · Try Again Later....
Read more >Mapping and Displaying Server-Side Errors With Formik in ...
Discussing how to properly map server-side errors to individual inputs and display the errors, which complements client-side validations ...
Read more >Client-side form validation - Learn web development | MDN
This is called client-side form validation, and helps ensure data submitted matches the requirements set forth in the various form controls.
Read more >Building and Validating Forms with Formik & Yup - YouTube
Learn how to handle, track, and display any server errors in your Formik form.
Read more >Server Side Validation | VeeValidate
It doesn't matter what kind of backend server you have, it can be Laravel or some Node.js framework. As long as the errors...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
workaround ≠ solution This is a rather really common use case and I think Formik could solve this in a much neater way. I think this issue should be reopened.
yep, instead of fixing/adding things let’s just close issues like nothing happened. not even surprised to see this bot here 😄