BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
i know that it is possible to get the value of a selected RadioButton in a group
through the function radiobutton.getSelectedValue(), but how can I SET the
value of RadioButton in a group and check the relative control ?
Maybe does it exists a radiobutton.setSelectedValue(value) function ?
Thank You.
Alberto.
let radioButton: RadioButton = new RadioButton({
label: 'Credit/Debit Card',
name: 'payment',
value: 'credit/debit',
checked: true
});
radioButton.appendTo('#radio1');
radioButton = new RadioButton({
label: 'Net Banking',
name: 'payment',
value: 'netbanking'
});
radioButton.appendTo('#radio2');
radioButton = new RadioButton({
label: 'Cash on Delivery',
name: 'payment',
value: 'cashondelivery'
});
radioButton.appendTo('#radio3');
radioButton = new RadioButton({
label: 'Other Wallets',
name: 'payment',
value: 'others'
});
radioButton.appendTo('#radio4');
document.getElementById('btn').addEventListener('click', function() {
var radioGrp = document.getElementsByName('payment');
for (let i = 0; i < radioGrp.length; i++) {
let radio = radioGrp[i] as HTMLInputElement;
if (radio.value == 'netbanking') {
radio.checked = true;
}
}
});
|
Hi Aravinthan,
Yes, it works very well.
Thank You very much.
Kind Regards.
Alberto Monteverdi.