@phil18799 I will give you an example:
Let us say you have a Radio-Button-Group which consists of 3-radio-buttons.
When you click each of the 3 given radio-buttons, a different functions starts for every button.
import {local} from 'wix-storage';
$w.onReady(function () {
$w("#myRadioGroup").onChange(()=>{
let selectedIndex = $w("#myRadioGroup").selectedIndex
console.log(selectedIndex)
if (selectedIndex===0) {function1();}
if (selectedIndex===1) {function2();}
if (selectedIndex===2) {function3();}
});
});
function function1(){... here the first function ...}
function function2(){... here the second function ...}
function function3(){... here the third function ...}
The event-handler is already existing —> “onChange”. Everytime when you change the value of the radio-button, it does some action (in this example it is calling one of the given 3-functions, depending on which radio-button was clicked).
I hope it help you to understand the code.
Good luck and happy coding. ![]()