F
Filamentβ€’14mo ago
toeknee

Forms - submitaction removal?

How can we condition if a submit action should be possible in forms as it doesn't accept a closure?
6 Replies
awcodes
awcodesβ€’14mo ago
Can you not just disable it? Seems like bad UX to not have it at all on a form.
toeknee
toekneeβ€’14mo ago
So this is a review state, so without duplicating the form or more code, I was hoping to condition the submitAction button based on a value. I also tried disabling the form and that fails because between the reactive requests the public properties are being lost.
awcodes
awcodesβ€’14mo ago
I guess you could conditionally generate the appropriate array of actions in the getFormActions method on the EditResource.
toeknee
toekneeβ€’14mo ago
This is a form, not a resource πŸ˜‰ in a custom livewire component
awcodes
awcodesβ€’14mo ago
then just conditionally display it in the blade view. πŸ™‚
toeknee
toekneeβ€’14mo ago
I am using ->submitAction(new HtmlString()) on the wizard... hehe Might have to move it but I wanted it inline But tbh maybe a submit bottom right makes sense opposed to inline to avoid confusion.