Enquiry about the submit button functionality in Kendo Form.

1 Answer 20 Views
Form
junghoon
Top achievements
Rank 1
junghoon asked on 04 Apr 2024, 01:27 AM
In Kendo Form, pressing the Enter key triggers the submit button click. However, I want to disable this default behavior of the Enter key and make the form to be submitted only when the submit button is clicked.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 05 Apr 2024, 08:34 AM

Hi Jinghoon,

This is the standard behavior of the forms and there are different ways to prevent the Enter key for submitting the form. By default, the first submit button will be used to submit the form when the Enter key is pressed, so one option using the KendoReact Form would be to change the type of the button to "button" and handle its click event to submit the form:

            <button
              type={'button'}
              onClick={() => formRenderProps.onSubmit()}
              className="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
              disabled={!formRenderProps.allowSubmit}
            >
              Submit
            </button>

Other options can be found in the following forum thread:

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
Form
Asked by
junghoon
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or