0

I want to select options from Radio buttons from different groups of buttons. I am only able to select only one option from all Radio button groups in the component.

enter image description here

enter image description here

in the above example, I want to select One option from the First group and another from the Second group of buttons

3

For each radio group, name attribute should be unique.

I can make an assumption, that in your case attributes name are the same.


salesforce recommends not to set name, as it will be generated automatically.

In general, we don't recommend setting the name attribute in lightning-radio-group. The component automatically generates a unique value for name if none is provided. The generated value ensures a common name for the elements rendered for the radio button group, and is unique in the page.

<template>
    <lightning-radio-group label="Radio Group"
                          options={options}
                          value={value}
                          type="radio">
    </lightning-radio-group>

    <lightning-radio-group label="Radio Group"
                          options={options}
                          value={value}
                          type="radio">
    </lightning-radio-group>
</template>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.