Hello all,
I have this very simple dropdown code from which I want to retrive its values
$w.onReady( function () {
$w( “#dropdown1” ).onChange((event) => {
let txtBoostPlan = $w( ‘#dropdown1’ ).value;
console.log( “dropdown1.value=” +$w( ‘#dropdown1’ ).value);
});
});
However when I preview the page I get the following
Thanks in advance
Fix-1:
$w.onReady(function () {
$w("#dropdown1").onChange((event) => {
let txtBoostPlan = $w('#dropdown1').value;
console.log("dropdown1.value = ", txtBoostPlan);
});
});
Fix-2:
$w.onReady(function () {
$w("#dropdown1").onChange(async(event) => {
let txtBoostPlan = await $w('#dropdown1').value;
console.log("dropdown1.value = ", txtBoostPlan);
});
});
Fix-3:
$w.onReady(function () {
$w("#dropdown1").onChange((event) => {
setTimeout(()=>{
let txtBoostPlan = $w('#dropdown1').value;
console.log("dropdown1.value = ", txtBoostPlan);
},50)
});
});
Which one of these fixes, works for you ?