is it possible to get value from parent form with form action modal?

Refer to https://filamentphp.com/docs/3.x/forms/fields/builder#using-get-to-access-parent-field-values I try with
$form // *main form
->schema
TextInput::make('first_form_value')
Forms\Components\Actions([
Forms\Components\Actions\Action::make() // *second form
->form([
Forms\Components\Actions([
Forms\Components\Actions\Action::make() // *third form
->form([
TextInput::make('third_form_value')
])
->action([ fn(Get $get,Set $set)=>self::setValue($get,$set) ]) // *set main form value
])
])
->action([
])
])
$form // *main form
->schema
TextInput::make('first_form_value')
Forms\Components\Actions([
Forms\Components\Actions\Action::make() // *second form
->form([
Forms\Components\Actions([
Forms\Components\Actions\Action::make() // *third form
->form([
TextInput::make('third_form_value')
])
->action([ fn(Get $get,Set $set)=>self::setValue($get,$set) ]) // *set main form value
])
])
->action([
])
])
on action that I said set main form value I calling Get,Set and push trough self::function on self::function I try to get value from third form and set value to first form with
$get('third_form_value')
$set('../../../first_form_value')
$get('third_form_value')
$set('../../../first_form_value')
but the result is when $get('third_form_value') it's show null then I try $get() it's show value from second form I try $get('../') it's show value of second form and third form and either I try ../../ ../../../ or else it's always show null how can I access value correctly on main , second and third form?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server