Move "Save changes" button to sit between fields
Is it possible to render the form buttons "Save changes" and "Cancel" so they sit between 2 fields instead of bottom or top of form?
I have my form which is made up of a text input, a code editor and a section that contains a fieldset which contains 3 checkbox lists. The check box lists are live so I'd like to put the save button before the section... any ideas?
Cheers, Tee
Solution:Jump to solution
I think you could get this to work with Form Actions:
https://filamentphp.com/docs/3.x/forms/actions#defining-a-form-component-action
And something like this for the action?
...
9 Replies
The check box lists are live so I'd like to put the save button before the sectionNot sure why you want this because of live checkboxes? Because they aren't saved automatically either.
Solution
I think you could get this to work with Form Actions:
https://filamentphp.com/docs/3.x/forms/actions#defining-a-form-component-action
And something like this for the action?
I have maybe misrepresented my code a bit... its a mashup of my own thoughts and GPT so it may be a little flakey. Let me try to explain π
The checkboxes update a pivot table and checking and unchecking does not need the save button to be pressed for changes in the db to happen.
I hope this helps shed light on my problem/desire to move the button, its not a big deal, just for UI purposes it makes a bit more sense to me to have the button after the code editor.
Cheers
Okay, makes sense if you immediately save the live checkboxes.
Can you try my proposal above?
like this? apologies if I am way off because this give the following
that worked perfectly π you don't happen to know the right method for cancel?
Cancel is probably just a redirect back.