Hello,
I added a switch input on my page and I need to add an onChange event,when the switch input came out at first, it had an onChange event, but now I can't find it, please can someone help me? Is it a bug?
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
Dear Heson, I have 2 parts in my website, 1) For adults, 2) For kids. When the user enters my website, he/she is going to be on adults page, after he/she can switch the switch input to go to kids page. I need the code for this. If you can, please help me. Thanks in advance!
Hi,
Can you expand more of your purpose???
There are few question.
① Do you want web user switch on/off to go to different page ?? Would menu bar better??
② There are some logical problem.
If your switch input default value was false, it means web-user never go to "/home".
It's because action was started by web-user switch the switch input. Therefore, web-user only can do one single action from this switch input, from false to true.
Dear Yisrael, please can you tell me how can I have this code with onClick event?
export function switch1_change(event, $w) { if($w('#switch1').checked === true) { wixLocation.to("/blog"); } else{ wixLocation.to("/home"); } }
You should use the onClick handler.