Topic: Datepicker issues
Danny priority asked 2 years ago
Datepicker events are not working, see https://mdbootstrap.com/snippets/standard/danny3445/3659952
Dawid Wajszczuk staff answered 2 years ago
Events are working fine. See this snippet https://mdbootstrap.com/snippets/standard/d-wajszczuk/3662809 :)
Danny priority commented 2 years ago
Then update your docs :) https://mdbootstrap.com/docs/standard/forms/datepicker/#docsTabsAPI const myDatepicker = document.getElementById('myDatepicker')
myDatepicker.addEventListener('open.mdb.datepicker', (e) => {
// do something...
})
Dawid Wajszczuk staff commented 2 years ago
And what is wrong in this docs?
Danny priority commented 2 years ago
This is wrong: const myDatepicker = document.getElementById('myDatepicker') myDatepicker.addEventListener('open.mdb.datepicker', (e) => { // do something... })
Dawid Wajszczuk staff commented 2 years ago
And what exactly is wrong with this working code? https://mdbootstrap.com/snippets/standard/d-wajszczuk/3669045#js-tab-view :)
Danny priority commented 2 years ago
It was confusing because everywhere there was only an ID on the input, and nowhere on the div. Adding an html example to the javascript was more clear.
Dawid Wajszczuk staff commented 2 years ago
On the other hand, every selector (like here https://mdbootstrap.com/docs/standard/forms/datepicker/#section-translations) is always related to div
element. There is no querySelector for input.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 3.10.2
- Device: Laptop
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: Yes