I want to enable and disable a button based on the value that is in the database.
I linked that cell to a text on my wix page but its not working
Here is the code,
$w.onReady(function () {
//TODO: write your page related code here...
let processedAnwser = $w('#text125').text; // textbox linked to database
if (processedAnwser === "yes" || processedAnwser === "Yes"){
$w('#button28').enable();
}
else{
$w('#button28').disable();
}
} );
Try something like this, however this might be over doing it and you will need to match up the curly brackets and parentheses to make sure that you have equal pairs of open { and ( and close } and ).
$w.onReady( () => { $w("#myDataset").onReady( () => { $w('#text125').value = $w("#myDataset").getCurrentItem().fieldName; if ($w('#text125').value === 'Yes') { $w('#button28').enable(); } else{ $w('#button28').disable(); } });