Good afternoon everyone. Hope someone can shed a bit of light on this.
I have 2 dropdowns and a button, and i am trying to use them to create a link to a dynamic page. One list is year, and the other is month, and in theory the button will then link to a page as set by the dates in the dropdown. However, i keep seeing this result in the console when i try it
Wix code SDK error: The url parameter that is passed to the to method cannot be set to the value 0. It must be of type string. (line 11)
The code i have for the button is as follows
import wixLocation from ‘wix-location’;
$w.onReady(() => {
$w(‘#button1’).onClick(()=> {
let url1 = wixLocation.url;
let space = $w(“/”);
let Events = $w(“Events”);
console.log(url1);
wixLocation.to(url1 & space & Events & space & ('#dropdown2').text & space & ('#dropdown1'.text));
});
});
line 11 is the line starting with wixLocation.to
i have displayed the url1 string ( wixlocation) in the console and all looks ok, however when i try adding extras to the string it shows as 0. I am figuring its something to do with the dropdowns, but i am not sure.
Thanks for any assistance here