Hello Everyone,
So I have a dropdown change event that will populate a text box with a number and what number that will be is determined by the selection made by the drop down. I have done something similar to this, just stuck and don't know how to fix this.
export function dropdown1_change(event) { let selectedIndex = $w("#dropdown1").selectedIndex; if (selectedIndex === 1){ $w("#text1").text =(100).toFixed(2).toString(); }if (selectedIndex === 2) { $w("#text1").text =(200).toFixed(2).toString(); }if (selectedIndex === 3) { $w("#text1").text =(300).toFixed(2).toString(); }if (selectedIndex === 4) { $w("#text1").text =(400).toFixed(2).toString(); }if (selectedIndex === 5) { $w("#text1").text =(500).toFixed(2).toString(); } }
Any help would be greatly appreciated.
The index starts from zero.