Hi All,
I am sure this must be straight forward but I just can’t find this at the moment …
I am trying to add a RADIO INPUT SELECTOR to my form and then if the “YES” selection is used, an additional input box should appear … if a NO selection is made then said input box should disappear … as per below
Thanks
Have you tried using the onChange event to have something run when the radio group buttons are changed?
https://www.wix.com/corvid/reference/$w.RadioButtonGroup.html#onChange
So use onChange and if yes is selected then have the additional element show and if no is selected then have the additional element hidden.
Something like this.
$w.onReady(function () {
});
export function radioGroup1_change(event) {
if ($w('#radioGroup1').value === 'YES') {
$w('#additionalElement').show();
} else {
if ($w('#radioGroup1').value === 'NO') {
$w('#additionalElement').hide();
}
}
}
Just make sure that your radio buttons have their values set to the same as what you are using in the code. The code does not use the radio buttons labels.
Also, remember to add the onChange event for the radio button group in the properties panel.
Plus remove the default choice if you want the user to select either Yes or No, otherwise it will always be defaulted to Yes if that is your first radio button.
Thats awesome! … work a treat - thanks very much 