Hello friends! I have a lot of dropdowns and what I need is that if one of them is not completed the button is not shown. I try this code but when I complete the dropdown the button is not shown. someone could help me ? Thanks a lot
$w.onReady(function () {
let value = $w("#dropdown").value;
if (value === "") {
$w('#button').hide();
} else {
$w('#button').show();
}
});
You need to check if it's undefined because when there is no value it will be undefined it will not gonna be empty string. Also, if you have default selected item from dropdown it will not gonna be undefined.
Example:
$w.onReady(function () { let value = $w("#dropdown").value; if (value === undefined) { $w('#button').hide(); } else { $w('#button').show(); } });