Dropdown Box & URL Button Linked (Database)

Hi Jack

The above is the full code to control it.

You need this at the top:

import wixData from 'wix-data';
import wixLocation from 'wix-location'; 

This section selects the current item in your dataset:

  • Change dataset1 with the name of the dataset you are wanting to search through.
export function dropdown1_change(event, $w) {
	$w("#dataset1").setCurrentItemIndex(event.target.selectedIndex)
		
} 

//when you click the item in your dropdown, 
//it selects the corresponding item row in the dataset
//*if you don't do this it will just use the first item in your dataset*

Attach this to the button you want to use as your “Click to Search”:

  • Change dataset1 with the same name as the above dataset.

  • Change links to the column name in your dataset (the one with the URL in it)

export function button32_click(event, $w) {
        wixLocation.to($w("#dataset1").getCurrentItem().links);

} 

//previous code selects the row
//this code selects the URL column
//then opens the browser page to the link you have in the column

Hope it works!

Thomas