F
Filamentβ€’2y ago
Ansori

How to make loading button on form submit?

Hello, I've created a custom page that implements the HasForm interface. However, I noticed that when I submit the form, the button does not display a loading or disabled indicator like when using the resource. I've attempted to add wire:loading.attr="disabled" to the filament button, but it still does not seem to be working. Does anyone have an idea?
<x-filament::page>
<x-filament::form wire:submit.prevent="submit">

{{ $this->form }}

<x-filament::button type="submit" wire:loading.attr="disabled">
Submit
</x-filament::button>
</x-filament::form>
</x-filament::page>
<x-filament::page>
<x-filament::form wire:submit.prevent="submit">

{{ $this->form }}

<x-filament::button type="submit" wire:loading.attr="disabled">
Submit
</x-filament::button>
</x-filament::form>
</x-filament::page>
5 Replies
Dan Harrin
Dan Harrinβ€’2y ago
add form="submit"
LeandroFerreira
LeandroFerreiraβ€’2y ago
wire:target="submit" ?
Dan Harrin
Dan Harrinβ€’2y ago
this is a shortcut i think for the filament::button
LeandroFerreira
LeandroFerreiraβ€’2y ago
I didn't know. Thank you πŸ‘Œ
Ansori
AnsoriOPβ€’2y ago
cool.. it's working now, thanks.
<x-filament::button form="submit" type="submit">
Submit
</x-filament::button>
<x-filament::button form="submit" type="submit">
Submit
</x-filament::button>
Want results from more Discord servers?
Add your server