Secondary Modal Submit Action with RequiresConfirmation
Im trying to add another submit action on a modal that requires a confirmation. Tried adding that, but cant seem to get access to the original actions form. Any suggestions? I tried also using makeSubmitAction too, but it doesnt allow you to add a requiresConfirmation or much else to it.
Solution:Jump to solution
try
```php
->modalFooterActions([
Action::make('save_confirm')
->label('aubmit for review')...
15 Replies
->modalSubmitAction(fn($action) => $action->requiresConfirmation())
?
@toeknee Doesn't appear to support requiresConfirmation()
Ahh of course you can just use a normal action then and apply your own action method to save first
@toeknee sorry, not completely following you
try:
@toeknee ah, didnt know about submit. Though seems to just save it and ignores the requiresconfirmation
Solution
try
@toeknee I think that did it. Thanks so much for your personal help. Really appreciate it!
Most Welcome!
@toeknee sorry, i lied. While I am definitely still thankful, it seems that $data never gets to that footer action. I know I am probably missing something simple and do appreciate your patience if its just going over for head for some reason.
Actually that makes sense.... I would just do:
is similar?
yes, thats my original problem that i posteda bout. $data is always an empty array
Of course because $data is expected from a form on the action, one minute. let me work out the save logic
$livewire->data
potentially?@dissto i can check again, but im pretty sure that looks at the form of the page and not that of the parent action
@dissto yep, actually i think $livewire->mountedActionsData[0] actually will give me the data