+ Start a Discussion
rubel rana 6rubel rana 6 

Date picker placeholder

Hello folks,

I have a date picker and it has a default placeholder. I want to change it to dd-mm-yyyy, I added placeholder, but in page, it is not showing. Showing the earlier default text. What can I do?
I added placeholder, like this
<apex:input value="{!fromDate }" type="date" html-placeholder="dd-mm-yyyy" style="width:140px" />


User-added image

Kind regards,
Rubel
AnkaiahAnkaiah (Salesforce Developers) 
Hi Rubel,

Please refer the below article will help you to proceed further on your rquirement.

https://www.geeksforgeeks.org/how-to-set-placeholder-value-for-input-type-date-in-html-5/

If this helps, please mark it as best answer.

Thanks!!


 
rubel rana 6rubel rana 6
Hi @Ankaiah , I get this error after adding the code following the link you have given.

Code;
<apex:input value="{!toDate }" type="text" placeholder="MM/DD/YYYY" onfocus="(this.type='date')"/>

Error
Unsupported attribute placeholder in <apex:input> in SalesDashboard at line 86 column 105