Hello. I added a switch and when I click on it, I have it changing some text elements which works great! You can see the code below. The problem I have now is that when I click on it again to toggle it back, I can’t change the text back to how it was. I have no idea how to do this but it should be simple, no?
export function switch1_click(event) {
$w(‘#text113’).text = “Billed annualy at $59.99/year”;
$w(‘#text112’).text = “$4.99/month”;
}
Very simple (:
export function switch1_click(event) {
if ($w("#mySwitch").checked) {
$w(‘#text113’).text = “Billed annualy at $59.99/year”;
$w(‘#text112’).text = “$4.99/month”;
} else {
$w(‘#text113’).text = “NEW TEXT”;
$w(‘#text112’).text = “NEW TEXT”;
}
}
Oh wow. Thank you so much Pranthem. I did not see your reply so I’m sorry for not replying sooner! I’m trying this now but it does look like it will work and it was so simple, how did I miss that/??
Sometimes, it’s these tiny little things that get missed.
However, what actually matters is the fact that you tried to give it a shot and (almost) got it working (:
Yes that is very true! I really did try before posting 
1 Like