© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
rajul

How to dispatch filament form data using blade $dispatch method

When I am trying to
$dispatch
$dispatch
an event to send filament form data, it is not sending updated form data. However If use dispatch inside livewire component I am able to get updated data. But by calling dispatch in livewire component will result in server call. I am trying to avoid server call.

This is not send updated data:
<div>
    <div class="p-4">
    <form wire:submit="create">
        {{ $this->form }}
        <button  
            class="bg-gray-800 text-white rounded p-2 mt-2" 
            x-on:click="
                $dispatch('jobsupdated', { data: {{ json_encode($this->form->getState()) }} })
            " 
        >
            Submit
        </button>
    </form>

    </div>
</div>
<div>
    <div class="p-4">
    <form wire:submit="create">
        {{ $this->form }}
        <button  
            class="bg-gray-800 text-white rounded p-2 mt-2" 
            x-on:click="
                $dispatch('jobsupdated', { data: {{ json_encode($this->form->getState()) }} })
            " 
        >
            Submit
        </button>
    </form>

    </div>
</div>


However this is sending correct data:
public function create(): void
    {
        $this->dispatch('jobsupdated', data : $this->form->getState());
    }
public function create(): void
    {
        $this->dispatch('jobsupdated', data : $this->form->getState());
    }


Please let me know if there is a way to send updated form data from blade file itself to avoid server roundtrip.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to override filament default form data store method
FilamentFFilament / ❓┊help
2y ago
How to open a filament modal using dispatch?
FilamentFFilament / ❓┊help
15mo ago
(Filament Exporter) Can I Mapping Data Using view blade?
FilamentFFilament / ❓┊help
2y ago
Can't dispatch inside a Filament component in my blade
FilamentFFilament / ❓┊help
3y ago