Hello all,
I will start off with thanking everyone for the abundance of examples and information on using WixCode. I am brand new to coding.
I have done a good amount of searching and can't find information on what I am trying to accomplish. Basically I want to have a userinput dropdown element that has multiple categories already listed. Once the user selects one of these categories and clicks the submit button it loads a specific page based off of the category they chose.
Any help would be greatly appreciated. If there happens to be another post answering this, I apologize, I didn't find it.
Thank you!
![](https://static.wixstatic.com/media/a27d24_05e3265fb2484ebbb93e97459e682708~mv2.png/v1/fill/w_49,h_23,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_05e3265fb2484ebbb93e97459e682708~mv2.png)
You can use the onClick() event handle function to find which option was selected, and then use wixLocation.to() to jump to the page you want. Something like this:
import wixLocation from 'wix-location'; ... export function selection1_click(event, $w) { let dropdownSelIndex = $w("#selection1").selectedIndex; console.log(dropdownSelIndex); if(dropdownSelIndex === 1) { wixLocation.to("/page1"); } else if(dropdownSelIndex === 1) { wixLocation.to("/page2"); } }
I hope this helps,
Yisrael
Thank you Yisrael! You are awesome... that worked great!