How i can disable submit button until form is fully validated filament

Forms\Components\Select::make('from_id')->relationship(name: 'from',
modifyQueryUsing: fn (Builder $query, Get $get) => $query->where('id', '!=', $get('to_id')))
->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}")
->preload()
->searchable()
->required()
->live(onBlur: true)
->afterStateUpdated(function (Forms\Contracts\HasForms $livewire, Forms\Components\Select $component) {
$livewire->validateOnly($component->getStatePath());})->rules([
fn () => function (string $attribute, $value, Closure $fail) {
$wallet = Wallet::find($value);
if(intval($wallet->balance) === 0) {$fail('The :attribute wallet is empty.');},]),
Forms\Components\Select::make('from_id')->relationship(name: 'from',
modifyQueryUsing: fn (Builder $query, Get $get) => $query->where('id', '!=', $get('to_id')))
->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}")
->preload()
->searchable()
->required()
->live(onBlur: true)
->afterStateUpdated(function (Forms\Contracts\HasForms $livewire, Forms\Components\Select $component) {
$livewire->validateOnly($component->getStatePath());})->rules([
fn () => function (string $attribute, $value, Closure $fail) {
$wallet = Wallet::find($value);
if(intval($wallet->balance) === 0) {$fail('The :attribute wallet is empty.');},]),
No description
1 Reply
Aminne
Aminne2w ago
I added this code
])->extraModalFooterActions(fn (Actions\Action $action): array => [
$action->makeModalSubmitAction('submit')
->color('info')
->disabled()
])
])->extraModalFooterActions(fn (Actions\Action $action): array => [
$action->makeModalSubmitAction('submit')
->color('info')
->disabled()
])