How to using RadioButton inside a telerik Form component

1 Answer 167 Views
Form RadioButton
Giovanni
Top achievements
Rank 1
Iron
Iron
Iron
Giovanni asked on 09 Jun 2022, 07:32 AM

Hi, I tried to use a RadioButton inside a telerik Form component but it seems not working.

I started from the example on

https://www.telerik.com/kendo-react-ui/components/form/get-started/

And I added a checkbox (it works fine) and 3 radiobutton, but it is not clear for me how use them: they doesn't load initial values and not falls on the submit json.

This is my example:

https://stackblitz.com/edit/react-oxhaws?file=src%2FApp.js

 

Are there some example on this case?

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 10 Jun 2022, 04:27 PM

Hello Giovanni,

You should use FormRadioGroup component in order to access the check state of the Radio buttons when the form is submitted. The following example demonstrates the KendoReact Checkbox and RadioGroup components within a form. The initial values of the RadioButtons are fetched from a JSON object and the selected item's value is available in the dataItem on submit (you can see it in the alert() message):

https://stackblitz.com/edit/react-zj2te7-5hezmu?file=app%2Fmain.jsx

Regards,
Vessy
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 RadioButton
Asked by
Giovanni
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Vessy
Telerik team
Share this question
or