Search...
value
Sets or gets the value of the selected option.
Description
Setting the value
property sets the options
property's value
to be the selected option. You must set the value
property to a value that exists in the options
list.
To reset the mobile picker to have no options
selected, set the value
property to an empty string, null
or undefined
.
Getting the value
property returns the value of
the currently selected option. If no value is selected, the
value
property returns an empty string.
Notes:
- Changing a mobile picker's
value
in code does not trigger anonChange
event.- If multiple options are currently selected, the
value
property returns the first selection. To get all the selected options, use theselectedIndices
property.
Type:
stringRead & Write
Was this helpful?
Get the value of the selected option
Copy Code
1let selectedOptionValues = $w('#mobilePicker1').value; // 'Large'
Set the selected option by value
Copy Code
1$w('#mobilePicker1').value = 'Large';