F
Filamentβ€’2mo ago
Mustafa_Dev

How to disable submit button on RM?

I wanna know how to disable submit button on a modal (Relation Manager). based on condition.
2 Replies
dissto
disstoβ€’2mo ago
I suppose you could do something like:
Tables\Actions\CreateAction::make()
->modalSubmitAction(function (StaticAction $action) {
return $action->disabled(fn (): bool => true);
})
Tables\Actions\CreateAction::make()
->modalSubmitAction(function (StaticAction $action) {
return $action->disabled(fn (): bool => true);
})
But keep in mind that the form can still be submitted by simply pressing enter πŸ˜‚ So i think it would probably be better to have a custom validation instead that would prohibit the form from being submitted either way πŸ€” What is your condition though?
Mustafa_Dev
Mustafa_Devβ€’2mo ago
I will give it a try πŸ‘