Hello.
I’m dealing with simple dashboard. I know not much on the code, but I’m learning. I have already made all the bottons, embedded the code in it so that thay are interactive and shown up on click. However now, I need to figure how to do one additional simple thing with the Drop Down: e.g. We have 4 options (4 values) and if I choose one, for example 1, then I need to go to another page. But I reeally don’t know how to manage that. I saw one guy was making something like that, but I presume he made a dynamic page and somehow connected to it. I want to get to the simple new or existing page. That simple.
If you ask me how I see it, then I see it as follows:
if ($w(‘#dropdown1’).value === 1)
{ LOCATION;}
But the questions are:
- How to link to that 1 selection any action
- Where to locate - how to write the script for the new or existing page since there are no IDs on the pages
- Is there any examples of managing this sort of Drop Down questionary…
Thank you in advance.
Hello Serdar!
I will answer your questions, fell free to clarify things if smth is not clear enough
-
You should bind this code to onChange event. I mean create dropdown, select it, add onChange handler:
2018-01-15_1703
Then add code to created function
-
You should use this function to navigate - https://www.wix.com/code/reference/wix-location.html#to
you can refer to pages by their names, it’s described in that module examples
This is an example: https://www.screencast.com/t/MdYL0dczjuc
-
You can search this forum)) There is a search field in uper top corner
At least i remember this topic regarding your question
https://www.wix.com/code/home/forum/questions-answers/how-to-use-dropdown-menu-to-jump-to-other-pages
Whoa, thank you Mike.
I saw that 3rd pattern. I was trying to implement it (echoes in my simple coding above), but all was unfortunate. I dont know what is going on today with WIX (cant reach the Save and Preview buttons…), Ill try tomorrow to implement all the coding you provided to me, step-by-step.
And again, thank you very much indeed. By the way, am I correct that the same steps I can also make when Im doing the Input boxes? I mean User imputs on menu? This is also way to go…
Kr
Serdar