Hi everybody, I'm only a beginner at wix coding and I wrote the following code, but it's not working as coded.
$w.onReady(function () { let language = wixWindow.multilingual.currentLanguage if (language === "nl") { $w('#form1').show() $w('#form2').hide() } else if (language === "fr") { $w('#form1').hide() $w('#form2').show() } });
On startup with the language "nl", form1 shows up and not form2 as it should be. Then when changing the language to "fr" there are no forms to be seen any more. When going back to "nl" no forms are showing up any more, not even the one that showed up at startup.... Can anyone help me and put me on the right track please.
Maybe I got something wrong or are forgetting a part of code?
Thanks for your help
If you use Wix Forms there are 2 options for ID, try to hide and show the second option (see screenshot)
Try to add console.log():
//...code... let language = wixWindow.multilingual.currentLanguage; console.log('language', language); //....code...
And see what it logs to the console., maybe it will give you a clue what the problem is.