Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Hidden field not sent to the server ?

Hello,

I have this field.

<input type="hidden" name="{{ $fieldName }}" wire:model.live="item_key">

If I keep the type hidden, the value isn't sent to the server.

But if I replace by the type text, the value is sent to the server.

I don't understand why ... it worked fine in Livewire v2, but not any more in Livewire v3.

Or is there any other reason that the Livewire version ?

Thanks for your help ;).

V

0 likes
3 replies
LaryAI's avatar
Level 58

Solution:

This is a known change in Livewire v3. In Livewire v2, <input type="hidden"> fields bound with wire:model or wire:model.live were automatically tracked and updated by Livewire. However, in Livewire v3, hidden inputs are intentionally ignored unless they have a wire:model binding and their value is changed via JavaScript or some manual event, due to performance reasons and to avoid unnecessary dom updates.

Why doesn’t it work?

  • Hidden fields don't trigger user events (like input or change), so Livewire doesn’t detect any value changes unless you set the value programmatically.
  • With type="text", user input is possible (and events fire), so Livewire notices and updates the value.

How to fix:

You should use wire:model.defer instead of wire:model.live on hidden fields, and set the value via Livewire (not just via the DOM). This way, hidden inputs' values will stay in sync via the Livewire property, and will be sent to the server when the form is submitted.

Example:

<input type="hidden" name="{{ $fieldName }}" wire:model.defer="item_key">

Or, if you want it to update on user or programmatic input, you can use Alpine.js to trigger an update:

<input type="hidden" name="{{ $fieldName }}"
       x-data
       x-model="$wire.item_key"
       wire:model.defer="item_key">

Best Practice:

  • Use wire:model.defer for hidden fields.
  • If you need to change the value dynamically, always update the Livewire property (item_key).
  • Don’t rely only on changing the DOM value of a hidden input. Update the property in the component instead.

References:


Summary:
Livewire v3 doesn't track hidden fields with wire:model.live because there's no event to trigger updates. Always use wire:model.defer on hidden inputs, and update their values through Livewire, not just the DOM.

MuhammadAli2003's avatar
Level 1

I think the key thing here is that the value might look correct in the DOM, but Livewire only cares about its internal state.

With hidden inputs, nothing actually triggers an update, so even if the value is present in the HTML, it may never sync to the Livewire property.

A quick way to confirm would be:

– check the request payload in the network tab (is the field missing or just empty?)
– dump/log item_key right before submit to see if Livewire actually has the value

If it’s not there, then it’s probably not a “form issue” but more of a state sync issue between DOM and Livewire.

Are you updating item_key from backend logic or via JS/Alpine?

1 like
vincent15000's avatar

In the network tab, the field is missing in the payload.

Thank you ;).

Please or to participate in this conversation.