Is it possible to submit Kendo React Form programatically without submit button?

1 Answer 567 Views
Form
nodsec
Top achievements
Rank 1
Iron
Iron
nodsec asked on 21 Mar 2023, 06:32 PM | edited on 21 Mar 2023, 06:33 PM

Hi, I would like to ask, if is somehow possible to submit Kendo Form programatically. I checked Form ref and also formRenderProps, but there is not method "submit" (or another) to submit form by the script.

Is it somehow possible? I would like to somehow submit this example form without submit button.


// How to submit this form programatically by the script (without submit button)?

<Form onSubmit={handleSubmit} ref={refForm} validator={formValidator} initialValues={initialValues} render={(formRenderProps) => { return <FormElement> <fieldset className={"k-form-fieldset"}> <div className="mb-3"> <Field name={"title"} component={ValidatedInput} label={"group.title"}/> </div> <div className="mb-0"> <T _translateProps={['label']}> <Field name={"description"} component={ValidatedTextArea} label={"group.description"}/> </T> </div> </fieldset> </FormElement>; }} />;

Thanks a lot.

 

1 Answer, 1 is accepted

Sort by
1
Konstantin Dikov
Telerik team
answered on 21 Mar 2023, 06:38 PM

Hello Nodsec,

Using the "ref" is the correct way of submitting the Form programmatically. You need to use refForm.current.onSubmit() to trigger the submit function. Following is an example demonstrating how to achieve this:

Hope this helps.

 

Regards,
Konstantin Dikov
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
nodsec
Top achievements
Rank 1
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or