F
Filamentβ€’5w ago
Lloyd

Modal Form Submission - Exit After Submission

Hey folks, is there a way to ensure that the modal doesn't exit when you press "Submit" on the form? I'm wanting to fetch some content via an API, then display it there. Thanks in advance!
Solution:
Build a cutom save action which saves and refreshes. Or have a wizard, on next if passes validation, save and on save, review the result?
Jump to solution
4 Replies
Jorqensen
Jorqensenβ€’5w ago
Firstly you'll need to fetch the data via XHR (AJAX). Otherwise the form submission will by default refresh the whole page, resulting in the modal closing. Secondly, if the modal is supplied by some UI/component lib, it might have some default behavior where it closes the modal on submission. You will need to alter that behavior, or not have it in the first place if you made the modal by hand. Wait a second I just realised this is the Filament server, forget what I said πŸ’€
Solution
toeknee
toekneeβ€’5w ago
Build a cutom save action which saves and refreshes. Or have a wizard, on next if passes validation, save and on save, review the result?
toeknee
toekneeβ€’5w ago
or buid a custom form
Lloyd
Lloydβ€’5w ago
Thanks guys!
Want results from more Discord servers?
Add your server