Force select value based on a toggle option
I have a select value with three possible values (0 ,1, 2) ,next to it I've a toggle, when the toggle is true, the select value must be 2.
So on my Toggle I'm using ->reactive()->afterStateUpdated( to update the select value, and on my select I'm using disabled(fn ($get) => $get('my_toggle') === true).
The problem is that now the select values does not gets submitted, so the value is never updated. Is there a "pretty" way to do it ? As there's no readonly method on Select.
I could use a hidden field, and update it, but looks messy.
Thnx for your help!
3 Replies