missy xoxo
missy xoxo

Reputation: 9

Add button inside form in Filamentphp v2

Have you tried creating a form in filamentphp with button inside it? I want to add button inside the field set and it's function is to clear the radio button.

What I have in my form is a field set and inside it there are 3 radio button.

Upvotes: 1

Views: 1351

Answers (2)

Abish R
Abish R

Reputation: 61

I'm on filamentphp v3, did by calling classes like

\Filament\Forms\Components\Actions
\Filament\Forms\Components\Actions\Action

Upvotes: 0

HijenHEK
HijenHEK

Reputation: 1296

you can always add a formAction field which has an action button that can access other fields using the $get and $get

        Forms\Components\Actions::make([
            Forms\Components\Actions\Action::make('button name')
              ->action(function (Forms\Get $get, Forms\Set $set) {
                  $result = 'do something'
                  $set('anotherfield', $result);
             })
        ]),

Upvotes: 1

Related Questions