I have attached the code below. I want to be able change non dynamic text based on a user input. Then based on the non dynamic text (it will say 'In' or 'Out') I want to then disable a button and a dropdown element.
I can get both aspects to work individually, but can't get them to work in tandem. Can anyone tell me what I'm doing wrong with my code?
import wixData from 'wix-data' $w.onReady(function(){ $w("#dataset2").onReady( ()=>{ let theChoice = $w("#text49").text; if (theChoice === 'Barcelona'){ $w("#text55").text = 'Out' } else { $w("#text55").text = 'In' } }) .then(() =>{ if ($w("#text55").text === 'Out'){ $w("#dropdown3").disable(); $w("#button1").disable(); } else { $w("#dropdown3").enable(); $w("#button1").enable(); } }) }); Thanks
The dataset onReady() function is an event handler which is invoked when the dataset is ready and available. It does not have a .then().