Dear all,
I'm trying to build a landingpage that shows buttons based on a certain code that users put in a form on the landingspage (see picture attached). I'm using this code, but it doesn't work. Can someone please help?
Thanks!!
$w.onReady(() => {
if ($w("#input6") === "Test1") {
$w('#button3').show();
$w('#button4').hide();
} else if ($w("#input6") === "Test2") {
$w('#button4').show();
$w('#button3').hide();
}
})
Tried to achieve the same effect but it is not working. By default, buttons are set to hide. Based on a choice from a dropdown, one button is to show. Any help? The full code below:
$w.onReady(() => { }); export function dropdown1_click(event) { if ($w("#dropdown1").value === "Donate a Gift") { $w("#button8").show(); } else if ($w("#dropdown1").value === "Donate Cash") { $w("#button13").show(); } }
it works!!! Awesome guys - thank you so much!!
Would someone be able to help here? This is the last thing we need before we can get our website to go live! :) Thanks!!!
Thanks very much - makes a ton of sense. However, my buttons still don't appear when I submit the right code. Do you know what else I'm missing? My current code looks like:
export function button6_click(event) {
if ($w("#input6") === "Test1") {
$w('#button3').show();
$w('#button4').hide();
} else if ($w("#input6") === "Test2") {
$w('#button4').show();
$w('#button3').hide();
}
}
https://support.wix.com/en/article/corvid-reacting-to-user-actions-using-events
Thanks! I'm pretty new to this - would you be able to show me the code that would be required to do this? Thanks!!!
R.
First off your code is working as soon as the page loads as you have written it into the pages onReady function.
You need to seperate your code and add your onclick event handler for the actual submit button itself.