Clickable Drop down menu that takes the user to a URL / Code provided

Ok, this was not the code i wanted to provide, actually.
Something must have been gone wrong.

But anyway, my first question:
How many DROP-DOWN-ELEMENTS are involved in your issue?

As i can see, you are working with 2x-Dropdowns ? ? ?
a) —> sharedshuttledropdown
b) —> dropdown1

But in your description —> I have a dropdown list and the id is correct.

So, how many dropdowns do we have here?

Can you make a pic of your Propdown-Setup, so i can imagine your setup a little bit better?

Let’s say you have just one DropDown…

import wixLocation from 'wix-location';

$w.onReady(()=> {
	$w('#dropdown1').options = loadDropDown();
	
	$w('#dropdown1').onChange((event)=>{
		console.log(event.target.id);
		console.log($w('#dropdown1').label);
		console.log($w('#dropdown1').value);
		//-------------------------------------
		let url = $w('#dropdown1').value;
		wixLocation.to(url);
	});

});

function loadDropDown() {
	let options = [
		{label: 'Airportx', value: 'https://www.vitzael.com'},
		{label: 'Belize', value: 'https://www.youtube.com'}
	];
	return options;
}

2024-02-02 00_26_37-Wix Website-Editor _ WixWorld

And maybe you want to take a look onto a very old example-site…
https://russian-dima.wixsite.com/meinewebsite/website-navigation

1 Like