How to dispatch filament form data using blade $dispatch method

When I am trying to $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>


However this is sending correct data:
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.
Was this page helpful?