© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
2 replies
omar abdou

Form in custom page validation not working

class Checkout extends Page implements HasForms
{
    use InteractsWithForms;
....

    protected static string $view = 'filament.admin.resources.invoice-resource.pages.checkout';

    public ?array $data = [];

 public function form(Form $form): Form
    {
        return $form
            ->statePath('data')
            ->schema([
                Forms\Components\Section::make('Payment Information')
                    ->schema([
                        Forms\Components\Select::make('paymentMethod')
                            ->label('Payment Method')
                            ->options($this->getPaymentMethods())
                            ->live()
                            ->required(),

                        Forms\Components\Section::make(fn($get) => 'Payment with ' . $get('paymentMethod'))
                            ->visible(fn($get) => $get('paymentMethod') !== null)
                            ->schema(fn($get) => is_null($get('paymentMethod')) ? [] : $this->factory->resolve($get('paymentMethod'))->form()),
                    ]),
            ]);
    }
class Checkout extends Page implements HasForms
{
    use InteractsWithForms;
....

    protected static string $view = 'filament.admin.resources.invoice-resource.pages.checkout';

    public ?array $data = [];

 public function form(Form $form): Form
    {
        return $form
            ->statePath('data')
            ->schema([
                Forms\Components\Section::make('Payment Information')
                    ->schema([
                        Forms\Components\Select::make('paymentMethod')
                            ->label('Payment Method')
                            ->options($this->getPaymentMethods())
                            ->live()
                            ->required(),

                        Forms\Components\Section::make(fn($get) => 'Payment with ' . $get('paymentMethod'))
                            ->visible(fn($get) => $get('paymentMethod') !== null)
                            ->schema(fn($get) => is_null($get('paymentMethod')) ? [] : $this->factory->resolve($get('paymentMethod'))->form()),
                    ]),
            ]);
    }



the above code works but when submitting the form validation doesn't work even if the form is valid


what im i doing wrong thanks
Screenshot_2025-04-11_at_10.02.30_AM.png
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

Validation messages not working on custom page?
FilamentFFilament / ❓┊help
2y ago
Custom form validation messages not shown in FileUpload
FilamentFFilament / ❓┊help
2y ago
Toggle buttons not working in form integrated in custom ViewRecord page
FilamentFFilament / ❓┊help
16mo ago
Custom View Form Validation
FilamentFFilament / ❓┊help
2y ago