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

mahbubrn's avatar

how to catch the date from date picker calendar in livewire component

here is my code -

livewire blade:

<p class="datePick">
    <span> date </span>
    <input type="text" name="date" wire:model.live='date' placeholder="Date..." autocomplete="off">
</p>

livewire component:

public function updatedDate() {
    dd($this->date);
}

this is a date picker js plugin. when i click here in input field the datepicker calendar auto displaying and i select the date.

  • the problem is i cant catch the date from component which i select from datepicker. the "wire.live" not working here. so i dont understand how to catch the date from component when update any date.
0 likes
1 reply
jaseofspades88's avatar

If the date picker has an event function, use the following from your javascript to emit an event back to your livewire component.

<script>
    Livewire.emit('postAdded')
</script>

Please or to participate in this conversation.