How to get active tab in submit form
Instead of dividing into multiple forms and putting them in each tab, I have 1 form with multiple tabs.
And when I submit, I want to know which tab I'm submitting to, what should I do?
Please help me!
3 Replies
I think this is the component it's using:
https://github.com/filamentphp/filament/blob/3.x/packages/forms/resources/views/components/tabs.blade.php
So, does
$getActiveTab()
give you what you need?GitHub
filament/packages/forms/resources/views/components/tabs.blade.php a...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
NOTE: If you're using Validation in your form, then submitting separate tabs may bring validation errors on other tabs, which won't be visible, and thus may be confusing to the user when the form won't submit.
Related, albeit they went the other direction with it: https://discord.com/channels/883083792112300104/1161073934372978780/1161073934372978780
How to use $getActiveTab()?