Skip to main content
added 96 characters in body
Source Link
sfdcfox
  • 501.6k
  • 21
  • 473
  • 828

You need to specify a name and value, just as you would in normal HTML.

<lightning-input name={item.id} type="radio" value={item.options.a}></lightning-input>

This will allow you to get the radio behavior, as well as tell which item is selected.

Note that the name must be the same for all type="radio" that should behave as a single radio selection, which is why I used item.id as the unique name. You can derive another name if you desire, just make sure they are unique on the page.

Demo.

You need to specify a name and value, just as you would in normal HTML.

<lightning-input name={item.id} type="radio" value={item.options.a}></lightning-input>

This will allow you to get the radio behavior, as well as tell which item is selected.

Note that the name must be the same for all type="radio" that should behave as a single radio selection, which is why I used item.id as the unique name. You can derive another name if you desire, just make sure they are unique on the page.

You need to specify a name and value, just as you would in normal HTML.

<lightning-input name={item.id} type="radio" value={item.options.a}></lightning-input>

This will allow you to get the radio behavior, as well as tell which item is selected.

Note that the name must be the same for all type="radio" that should behave as a single radio selection, which is why I used item.id as the unique name. You can derive another name if you desire, just make sure they are unique on the page.

Demo.

Source Link
sfdcfox
  • 501.6k
  • 21
  • 473
  • 828

You need to specify a name and value, just as you would in normal HTML.

<lightning-input name={item.id} type="radio" value={item.options.a}></lightning-input>

This will allow you to get the radio behavior, as well as tell which item is selected.

Note that the name must be the same for all type="radio" that should behave as a single radio selection, which is why I used item.id as the unique name. You can derive another name if you desire, just make sure they are unique on the page.