F
Filamentβ€’2y 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β€’2y ago
Can you not just disable it? Seems like bad UX to not have it at all on a form.
toeknee
toekneeOPβ€’2y 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β€’2y ago
I guess you could conditionally generate the appropriate array of actions in the getFormActions method on the EditResource.
toeknee
toekneeOPβ€’2y ago
This is a form, not a resource πŸ˜‰ in a custom livewire component
awcodes
awcodesβ€’2y ago
then just conditionally display it in the blade view. πŸ™‚
toeknee
toekneeOPβ€’2y 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.
Want results from more Discord servers?
Add your server