© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Anish

Modal Open before validation

I have to extend the registration for panel to include Terms of Use & Policy. So, I am extending the vendor Register model by just changing the getRegisterFormAction.

Here is the code

public function getRegisterFormAction(): Action
    {
        return Action::make('register')
            ->requiresConfirmation()
            ->steps(Registration::getModalSteps())
            ->action(fn () => $this->register())
            //->submit('register')
            ;
    }
public function getRegisterFormAction(): Action
    {
        return Action::make('register')
            ->requiresConfirmation()
            ->steps(Registration::getModalSteps())
            ->action(fn () => $this->register())
            //->submit('register')
            ;
    }


I observed that if I don't add the action part, the modal is not triggered. I couldn't find any documentation.

Though it is easy to overcome, what I see that the modal is triggered before the registration form is validated. Is this the default behaviour? Is there a way to first have the validation and then trigger the modal?

Also the modal upon submit does not seem to close automatically. So if there are validation errors, it looks as though nothing has happened. Once you close the modal, then you find the errors. Again is the default behaviour? At least I hope not. Also, is there a way to close the modal when confirmation button (in this case Wizard Step) are completed?

Thanks in advance for any help.
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

Open modal before create action
FilamentFFilament / ❓┊help
3y ago
Open Modal after/before Creating record
FilamentFFilament / ❓┊help
9mo ago
Action trigger close modal before open
FilamentFFilament / ❓┊help
3y ago
How to modify data before validation in simple(modal) resource
FilamentFFilament / ❓┊help
11mo ago