How the get the option label from a select
So, I've got a
Select
and I want to fill a TextInput
with the value selected. Not the value of the option, but the label.
Say, I've got
When the user selects something
I want to fill a TextInput
with something
My Select
looks like this:
and my TextInput
:
I've tried using afterStateUpdated
injecting the state, the component, Get, Set, but the only thing I can get is the option
value (1 in this example).
How can I get something
from the selected option? Thanks in advance.3 Replies
You can use Get or Set but need a model query to retrieve the label. when setting / getting
I thought that might be the case, but wanted to leave it as a last resort, to avoid more db calls
Found the solution:
Nice, thanks for this code.
I think i'm gonna use it to!