Multi-step form validation and server-side validation

1 Answer 129 Views
Form
Romaine
Top achievements
Rank 1
Romaine asked on 23 Feb 2023, 08:23 PM

After server-side validation, I am calling forceUpdate() to update the UI.

But, this isn't "wired" to the FormSubmitClickEvent isValid - or at least not in the same time frame as the onStep function.

Is there a way to tie server-side validation in with FormSubmitClickEvent isValid? Since this process is asynchronous, I'm guessing it will be challenging.

 

... Called after server-side validation to update the UI - this works

setTimeout(() => {
formRef.current.forceUpdate();
});

 

... Called when user clicks the "next" button on the multi-step screen

const onStepClick = React.useCallback(
(event: FormSubmitClickEvent) => {

1 Answer, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 27 Feb 2023, 02:35 PM

Hi, Romaine,

Based on the provided description I understand that the forceUpdate() method is called successfully when using setTimeout, but it doesn't work when called insideonStepClick, is that correct? 

Tying the FormSubmitClickEvent together with the server-side validation would be challenging indeed, in order to assist further is it possible to provide a runnable example that reproduces the issue and more information on the current scenario?

Regards,
Filip
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.

Tags
Form
Asked by
Romaine
Top achievements
Rank 1
Answers by
Filip
Telerik team
Share this question
or