How can to disable 'create & create another' button on createOptionForm
Good day guys. How can i disable 'create & create another' button on createOptionForm
Forms\Components\Select::make('owner_id')
->relationship('owner', 'name')
->searchable()
->preload()
->createOptionForm([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
Forms\Components\TextInput::make('email')
->label('Email address')
->email()
->required()
->maxLength(255),
Forms\Components\TextInput::make('phone')
->label('Phone number')
->tel()
->required(),
])
->required()
TYSM.11 Replies
Give this a try.
Add this in your create resource
this method is not working.
jaocero is correct in the create resource
Probably:
not working sir @Dennis Koch
exact code:
->createOptionAction(
fn (\Filament\Forms\Components\Actions\Action $action) => $action->createAnother(false)
)
ERROR:
Method Filament\Forms\Components\Actions\Action::createAnother does not exist.
Did you try . in your create resource? Worked for me
Can you please share a screenrecording? I just tried with the demo and
createOption()
doesn't even have a "Create and create another" button per default 🤔good evening sir. @Dennis Koch
current code: https://pastebin.com/Y3Jjhypd
* in
fn (\Filament\Forms\Components\Actions\Action $action) => $action->modalWidth('2xl')
it works. but on fn (\Filament\Forms\Components\Actions\Action $action) => $action->createAnother(false)
it gives error.
please see the attachments:Pastebin
Forms\Components\Select::make('mini...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
up
Hm. I'm confused why you are having the "Create & create another option". That's not the default I have