Is there a way to get the selected label instead of the selected value?
I have a select that displays a list of cities, which will store the city_id.
In another input, I need to get the city name, not its id. The Get $get utility will retrieve the value, not the label. Is there accomplish this, aside from doing an additional query?
Solution:Jump to solution
Not really. Even with plain Livewire you'd need to work around this, since the select only transmits it's value not the label.
5 Replies
Nope... can you translate the value?
by translate you mean do an additional query, right?
yes, I will do that if it's the only possibility
Solution
Not really. Even with plain Livewire you'd need to work around this, since the select only transmits it's value not the label.
Hacky idea: Join ID and Label for the value, then split it up again in a
->afterStateUpdated()
thanks to both!! marking as solved