//this returns a guid similar to xxxx-xxxx-xxxx-xxxx, the dropdown is displaying the text correctly. It’s getting its list items from a referenced database.
I want to text value so i can match against a string for eg…
wixData.query(“Locations”)
.eq(“suburb”, suburb)
if i am approaching this wrong perhaps i should use a different approach?
ok, through the console log i found that my dropdown value is the id and the label is the text displayed just like c#, so is this a databinding? I tried to find a label property and text and neither exist. Is there a get the text value from the id in the databse?
If im reading it right, you just want to get the label of the dropdowns selected item rather than the value correct?
If so you can use dropdown options and selected index to find it, see below
let index = $w(“#dropdown1”).selectedIndex; // Get the selected index let itemOptions = $w(“#dropdown1”).options[index] // get the selected item let itemLabel = itemOptions.label; // grab the label of selected object let itemValue = itemOptions.value; // grab the value of selected object
console.log("Label = " + itemLabel) // the label of the selected dropdown item
console.log("Value = " + itemValue) // the value of the selected dropdown item