I would like to know when radio button is checked , it unchecks other object radio button. I have a object and for each object options, radio button is created.
For example, for id=SG two radio buttons are created, if no checked, set bank as default checked else set corresponding selected radio value as checked.
I got stuck in litelement.
for each obj
radio options are generated, by default 1st option is checked, but if I check credit
option for obj SG
, it uncheck default option in TH
const obj= [{
id: "SG",
options: ["bank", "credit"]
},
{
id: "TH",
options: ["bank","debit"]
}
];
render(){
${obj.map((e)=>{
return html`
<form>
${obj.options.map((option_value)=>{
return html`
<input class="form-check-input" name="sending-${country.id}" type="radio" id="provider-send-${option_value}" value=${option_value} ?checked=${option === 'bank'} >
<label class="form-check-label">
${option_value}
</label><br>
`})}
</form>
})`;
}
For each obj, default radio option should be checked if particular radio is checked for a obj