How to display the API errors in the form after submitting?

1 Answer 623 Views
Form Input Styling / Themes
Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
Wreeecks asked on 24 Sep 2021, 01:57 AM

I'm currently implementing frontend and backend validation.  I want validate the posted data on the server-side, so when the validation fails, it should highlight the Inputbox and display the error below it. The error is highly likely not the same as the validator error message.

Is there any demo for this? Also,  is there a documentation on how to interact with form, like triggering validation programmatically?

Regarding the code, I've copy pasted the from from the documentation https://www.telerik.com/kendo-react-ui/components/form

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Sep 2021, 05:48 AM

Hello, Rex,

This will be possible after this feature is completed:

https://github.com/telerik/kendo-react/issues/438

This will allow having built-in support for server-side validation.

I added this request to raise its priority.

Regards,
Stefan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
commented on 24 Sep 2021, 06:00 AM

Thanks, Stefan. I hope this feature gets released soon. 

On the side note, I've tried formik and I think it's a very good tool.  Maybe you can get some inspiration from it specially the support for 3rd party validator.  

Stefan
Telerik team
commented on 24 Sep 2021, 06:04 AM

Hello, Rex,

Thank you for the feedback.

When we are making the Form our lead developer of this component is looking at all popular forms including Formik to ensure that our Form component can cover most of the requirements. This is why we have this item logged, as we know that these are important features and we have to implement them for sure.

Filip
Telerik team
commented on 02 Dec 2025, 11:28 AM

Hello, Rex,

We are evaluating possible solutions for implementing server-side validation in the Form component. For now, we’ve developed a custom implementation that uses both server-side and client-side validation to closely reflect real-world behavior:

The Form's global validator runs on every input change and expects either an object in format `{fieldName: "error message"}` or `undefined` if no errors occur. Server errors are stored in separate state (serverErrors) and merged with client validation errors in the form validator function. They persist until the user modifies that specific field or a new server response overwrites them. In production the `simulateServerValidation` function has to be replaced with the actual API call that returns the properly formatted error object.

Could you please review the approach above and let me know whether it meets your requirements? Any additional feedback would be greatly appreciated.

Regards,
Filip

Tags
Form Input Styling / Themes
Asked by
Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Stefan
Telerik team
Share this question
or