question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A way to keep backend errors with client validation

See original GitHub issue

Here 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:open
  • Created 6 years ago
  • Reactions:45
  • Comments:32 (15 by maintainers)

github_iconTop GitHub Comments

36reactions
jarizcommented, Nov 7, 2017

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.

30reactions
vladshcherbincommented, Aug 15, 2018

yep, instead of fixing/adding things let’s just close issues like nothing happened. not even surprised to see this bot here 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found