Topic: mdb datepicker
jcarvalho priority asked 6 days ago
Expected behavior like to clear the selected date
Actual behavior the date is still highlighted in blue
Resources (screenshots, code snippets etc.)
selected date in the date table is not resetting.
$('#mydate').val(''');
Kamila Pieńkowska staff answered 5 days ago
Here is a working example: https://mdbootstrap.com/snippets/standard/kpienkowska/6328996
Kamila Pieńkowska staff answered 6 days ago
You should change the value in the input and then trigger the 'input' event with JS on the input element.
If it does not help please provide a snippet that recreates the issue.
The startDate
option does not equal selected date. It is a date that will visible when datepicker opens.
jcarvalho priority commented 6 days ago
Here is the examplelet ele = mdb.Datepicker.getOrCreateInstance(document.getElementById('myDate')); ele.value ='';
$("#myDate").val("").trigger("change");
both did not work.
Can you please provide sample?
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 6.4.1
- Device: mac os
- Browser: google chrome
- OS: Mac Os
- Provided sample code: No
- Provided link: No
jcarvalho priority commented 6 days ago
Could you please help to reset the highlighted date in Blue. mdb.Datepicker.getInstance(document.getElementById('mydate')).dispose(); mdb.Datepicker.getOrCreateInstance(document.getElementById('mydate')).update({'startDate' : null });
dispose and recreate did not work. Please help.