Question:
Good morning,
I am on the end of my knowledge. I need simply thing - I have a button on site of my website and need open lightbox with preselected dropdown field. I need solve this in velo because I want more buttons with linked dropdown item.
I have a code in rosegoldlook.eu/dokonaly-makeup:
import wixWindow from 'wix-window';
$w.onReady(function () {
$w('#btnpoptat01').onClick(function () {
let dataObj = {
"source": "btnpoptat01"
};
wixWindow.openLightbox("poptavka-popup", dataObj);
});
});
And code in lightbox with fields:
import wixWindow from 'wix-window';
$w.onReady(function () {
let dataObj = wixWindow.lightbox.getContext().data;
if (dataObj && dataObj.source === "btnpoptat01") {
$w("#dropdown1").selectedIndex = 6;
}
});
In past I wanted select item by option value, but for now I need simply set item by sorting.
Thank you very much!
Product:
Wix editor in developer mode (velo).