Topic: MDB5 Datepicker event not working

smachesney free asked 3 years ago


Using a snippet I reproduced my issue:

<div class="form-outline datepicker"> <input type="text" class="form-control" id="exampleDatepicker1" /> <label for="exampleDatepicker1" class="form-label">Select a date</label> </div>

const myDatepicker = document.getElementById('exampleDatepicker1') myDatepicker.addEventListener('open.mdb.datepicker', (e) => { // do something... alert('hello'); })

It doesn't work. The event listener doesn't fire.

Can you please provide me with a solution or workaround to listen out for event changes. The standard onchange event doesn't work

Thanks Sonia

Michał Duszak staff answered 3 years ago


You have to listen on the div here. I prepared a snippet for you:

Best regards,


smachesney free commented 3 years ago

Thank you so much Michal!

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 3.2.0
  • Device: desktop
  • Browser: Chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No