© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
Omar

Set default value to a select, listening the change from another input

Forms\Components\DatePicker::make('extinguisher_expiration')->live(debounce: 500),
Forms\Components\Select::make('extinguisher_status')
    ->options([
        'true' => 'true',
        'false' => 'false',
    ])
    ->default(function(Get $get){
        if(!is_null($get('extinguisher_expiration'))){
            return 'true';
        }
        return 'false';
    }),
Forms\Components\DatePicker::make('extinguisher_expiration')->live(debounce: 500),
Forms\Components\Select::make('extinguisher_status')
    ->options([
        'true' => 'true',
        'false' => 'false',
    ])
    ->default(function(Get $get){
        if(!is_null($get('extinguisher_expiration'))){
            return 'true';
        }
        return 'false';
    }),

I am trying to assign a default value to the select, which would be true when having a data and false when not having it, but it does not detect the change of the input date
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

Default value in Select input
FilamentFFilament / ❓┊help
2y ago
Setting a default value to another value from the table.
FilamentFFilament / ❓┊help
3y ago
set default value for select
FilamentFFilament / ❓┊help
3y ago
Set value of another field from within default
FilamentFFilament / ❓┊help
3y ago