F
Filamentβ€’3mo 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β€’3mo 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β€’3mo 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β€’3mo ago
or buid a custom form
Lloyd
LloydOPβ€’3mo ago
Thanks guys!
Want results from more Discord servers?
Add your server