F
Filament15mo ago
Badrul

conditional form disabled upon a toggle button

is it possible to disabled a form field depending on a toggle button
No description
2 Replies
Sanchit Patil
Sanchit Patil15mo ago
you can use ->disabled with Filament\Forms\Get
Forms\Components\Toggle::make('public_link')->reactive(), Forms\Components\TextInput::make('email')
->disabled(fn (Get $get): bool => $get('public_link'))
Forms\Components\Toggle::make('public_link')->reactive(), Forms\Components\TextInput::make('email')
->disabled(fn (Get $get): bool => $get('public_link'))
More here: https://filamentphp.com/docs/3.x/forms/advanced#conditionally-hiding-a-field
Badrul
BadrulOP15mo ago
Awesome man. Thank you so much for the Guidance. You are supercalifragilisticexpialidocious. 🦸 🙏
Want results from more Discord servers?
Add your server