© 2026 Hedgehog Software, LLC

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

Disable field while performing 'set'

Can Alpine be used to add a disabled attribute to a field while it's being updated?

Forms\Components\TextInput::make('name')
    ->afterStateUpdated(function (\Closure $set, ?string $state) {
        if (filled($state)) {
            // Temporarily disable the key to prevent any input while it's being updated
            $set('key', Str::slug($state));
        }
    })
    ->reactive(),
Forms\Components\TextInput::make('key')
Forms\Components\TextInput::make('name')
    ->afterStateUpdated(function (\Closure $set, ?string $state) {
        if (filled($state)) {
            // Temporarily disable the key to prevent any input while it's being updated
            $set('key', Str::slug($state));
        }
    })
    ->reactive(),
Forms\Components\TextInput::make('key')
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

disable field while 2 others are not filled in
FilamentFFilament / ❓┊help
3y ago
How to disable button after performing the action
FilamentFFilament / ❓┊help
3y ago
Disable table actions while searching
FilamentFFilament / ❓┊help
2y ago
Disable field during network request?
FilamentFFilament / ❓┊help
4w ago