© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
10 replies
ybzhnitees

How to validate a modal form before extraModalFooterActions runs?

I have a modal with a form and a custom footer button. I need to validate the form when this custom button is clicked, before its own logic runs.
However, the action's ->before() hook is never triggered, so I can't run validation.
Here is a simplified example of my code:

Action::make('formModal')
            ->form([
                \Filament\Forms\Components\TextInput::make('name')->rules('required')->markAsRequired(),
            ])
            ->modalSubmitAction(false) // Disable default submit button
            ->extraModalFooterActions([
                Action::make('confirmAction')
                    // PROBLEM: This hook is never called.
                    ->before(function () {
                        // I want to validate the 'name' field here,
                        // but this code never runs.
                        dd('This is never reached');
                    })
                    ->action(function () {
                        // This runs without validation.
                    }),
            ]),
Action::make('formModal')
            ->form([
                \Filament\Forms\Components\TextInput::make('name')->rules('required')->markAsRequired(),
            ])
            ->modalSubmitAction(false) // Disable default submit button
            ->extraModalFooterActions([
                Action::make('confirmAction')
                    // PROBLEM: This hook is never called.
                    ->before(function () {
                        // I want to validate the 'name' field here,
                        // but this code never runs.
                        dd('This is never reached');
                    })
                    ->action(function () {
                        // This runs without validation.
                    }),
            ]),

Is there a way to validate the form before proceeding to the modal footer action? (I don't want to validate by ->required())
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Validate Before Action Modal Renders
FilamentFFilament / ❓┊help
4mo ago
Close modal from a "extraModalFooterActions"
FilamentFFilament / ❓┊help
16mo ago
Validate and save before opening modal
FilamentFFilament / ❓┊help
2y ago
extraModalFooterActions in EditAction modal
FilamentFFilament / ❓┊help
2y ago