Nested Actions, Parent Form validation

Hi guys i have this scenario parent modal has form and submit is through custom action button which opens another modal, the parent form must be validated before moving to the child modal
->modalFooterActions(function($record){

// child actions
return [
Action::make('send_request')
->label(__('actions')['user-new-request-label'])
->modalSubmitAction()
->form(function($livewire, Action $action) use ($record){
$requestData = $livewire->mountedTableActionsData[0];
return [
Placeholder::make('notes')
->label('Notes')
->content(function(){
return "notes";
})
];
})
->modalFooterActions(function($record){

// child actions
return [
Action::make('send_request')
->label(__('actions')['user-new-request-label'])
->modalSubmitAction()
->form(function($livewire, Action $action) use ($record){
$requestData = $livewire->mountedTableActionsData[0];
return [
Placeholder::make('notes')
->label('Notes')
->content(function(){
return "notes";
})
];
})
any help would appreciated, thanks
4 Replies
toeknee
toeknee6d ago
If you call the getState on the parent form, it should trigger the validation naturally. so maybe $livewire->form()->getState() or similar.
Haydra
HaydraOP4d ago
thank you, i already tried this solution, but i ended up building modals with livewire components @toeknee is there a way to make a field hidden and alse send his value to the submit ? it's wizard step, mutating won't work
toeknee
toeknee4d ago
Is it a Hidden::make() field or is it ->hidden(true) ?
Haydra
HaydraOP4d ago
i can use Hidden or Select, but i prefer using Select

Did you find this page helpful?