Hi guys,
I have a question regarding a Dropdown List and Lightboxes.
I have a dropdown list of 3 items and a button to proceed. When the user choose 1 item in the list and presses the button, a correlating lightbox will open.
I found a code that potentially help me to do it, but I am not familiar with Wix Corvid syntax.
I’m also confused about the database. If Wix let me pull the data from the database and link it to a lightbox, that’d be so much easier. Apparently there is no option for that.
I have a data base of 2 columns: One for items name, and one is lightbox number (or sorting purposes).
Here’s the code I found:
import wixData from 'wix-data';
import wixWindow from 'wix-window';
// This part loads the Variety Lightboxes
export function dropdown1_change(event) {
//Open Lightbox Variety 1:
if ($w('#dropdown1').value === "Variety 1")
(wixWindow.openLightbox("Variety 1")
)
//Open Lightbox Variety 2:
if ($w('#dropdown1').value === "Variety 2")
(wixWindow.openLightbox("Variety 2")
)
//Open Lightbox Variety 3:
if ($w('#dropdown1').value === "Variety 3")
(wixWindow.openLightbox("Variety 3")
)}
Do I need to add a function onClick for the button?
I need your help.