Hi all!
I have in my home page a dropdown menu inside a state of a multistate box that works perfect:
reference: https://www.minicabtransfermalaga.co.uk
it works due to this code:
import wixLocation from 'wix-location';
$w.onReady(function () {
//code for switching state in multistate box
$w("#button73").onClick(() => {
$w('#PreloaderStateBox').changeState("Intro");
});
$w("#button72").onClick(() => {
$w('#PreloaderStateBox').changeState("express");
});
$w("#button82").onClick(() => {
$w('#PreloaderStateBox').changeState("Intro");
});
$w("#button83").onClick(() => {
$w('#PreloaderStateBox').changeState("express");
});
//dropdown menu code
$w("#dropdownOrigin").options = [
{"label": "MALAGA AIRPORT (AGP)", "value": "https://www.minicabtransfermalaga.co.uk/s1-route-selection-o-agp-iv"},
{"label": "MALAGA TRAIN (M.ZAMBRANO)", "value": "https://www.minicabtransfermalaga.co.uk/s1-route-selection-o-train-iv"},
//(...) the rest of the options with their links (...)
];
});
//to navigate to the dropdown menu value as link
export function dropdownOrigin_change(event) {
//Add your code for this event here:
let url = $w('#dropdownOrigin').value;
wixLocation.to(url);
}
The problem appears when I copied the multistatebox (and the code) to a dynamic page, it doesn’t work, neither the state change or the dropdown links.
For example in this one:
I have tried a lot of things without luck, and I thought that this one would work, but neither:
I tried to change the .onReady function to this:
$w(“#dynamicDataset”).onReady(function () { //(…)
I do not know why it does not work, I am sure that there is something missing in the code, I have chequed the corvid documentation but i have not found the solution.
Thanks in advance.