Topic: How to set placeholder in MDBDatePicker? Shows current date by default.
Nitin.Chanana asked 6 years ago
How to set placeholder in MDBDatePicker? It shows current date by default. We want to show "Select Date" as a place holder.
Jakub Mandra staff premium answered 6 years ago
Hi there,
To set text placeholder set value={null} and emptyLabel="Your text"
Nitin.Chanana commented 6 years ago
Hi, Thank you for your reply. We tried this but it does not work.
Our code:
<DatePicker className="datepick" value={null} emptyLabel="Select Date"/>
It still shows current date as default placeholder.
Jakub Mandra staff premium answered 6 years ago
Could you provide snippet with more code, please?
This solution was tested few times on different environments and was not causing any problems yet.
Nirmal Singh answered 4 years ago
It does not work on my project too. My code:
< MDBDatePicker disableFuture={true} emptyLabel="Select Date" value={null} name="uc_pwk_received" />
Piotr Glejzer staff commented 4 years ago
Do you have a pro version?
Nirmal Singh commented 4 years ago
yes, I do have a pro version
Krzysztof Wilk staff commented 4 years ago
Hi!
Try to use valueDefault={null}
instead of value={null}
and everything should work :)
Best regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.8.4
- Device: Laptop
- Browser: Google Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No
Nitin.Chanana commented 6 years ago
Can anyone please advise? It is very urgent.