confirmation on page exit

Hello! Is there a way to show confirmation if the user tries to exit the create resource page? It would be useful if the user accidentally clicks the close button or any other link while filling up the create resource form.
5 Replies
toeknee
toeknee14mo ago
Not at present
Dennis Koch
Dennis Koch14mo ago
You can archieve this with custom JS, but then it will always be shown regardless of user input
miteshnile
miteshnileOP14mo ago
Hi! I am really thankful for your reply. Can you please guide me to correct resource for custom js creation
Dennis Koch
Dennis Koch14mo ago
You can register a JS file containing your code that check whether you are on a /create/ url and include it via the Asset Facade: https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files
miteshnile
miteshnileOP14mo ago
Thank you for your reply! I really appreciate it for you taking out time and replying me and many other budding developers like me! I have successfully implemented the functionality using a custom js.
Want results from more Discord servers?
Add your server