Change input label dynamically

Hi! How can i change an Input Label according the another field/select/radio selected value? For example: I'm trying to change the label "Nome do Proprietário" to "Nome do Terceiro" when i choose "Terceiro" on the previous input.
3 Replies
Silvio Ney
Silvio Ney15mo ago
i tried with reactive() and using afterStateChanged on "Proprietario" input and using $set but i think $set is used to set the value, not the label of input.
josef
josef15mo ago
->label(static fn (Closure $get): string => $get('other field') === 'something' ? 'label 1' : 'label 2')
->label(static fn (Closure $get): string => $get('other field') === 'something' ? 'label 1' : 'label 2')
and make other field reactive
Silvio Ney
Silvio Ney15mo ago
amazing! worked like a charm! Thank you!