You can simply use the attribute like HTML "Placeholder" with some little change on apex page html-placeholder="dd-mm-yyyy". For better html view you should use the docType="html-5.0" on apex page atrribute
Then You can try something like this <ui:inputText placeholder="dd-mm-yyyy"> or whatever the type you ant to keep few more example : <ui:inputEmail aura:id="email" label="Email" placeholder="abc@email.com"/>
({
setPlaceholder : function(component, event, helper) {
var dtPlchldr=component.find('inputDate');
dtPlchldr.set('v.placeholder','[enter due date here]');
}
})
Try Something like this, becuase there is no attribute like placholder in ui:inputdate component
Hi Shradha, You can use an input field for entering a date because there is no place holder in ui:inputDate. So to enter date in exact format you can use input field.The date format is automatically validated during the onblur event.
You can simply use the attribute like HTML "Placeholder" with some little change on apex page html-placeholder="dd-mm-yyyy".
For better html view you should use the docType="html-5.0" on apex page atrribute Hope this help!
Then You can try something like this <ui:inputText placeholder="dd-mm-yyyy"> or whatever the type you ant to keep
few more example : <ui:inputEmail aura:id="email" label="Email" placeholder="abc@email.com"/>
INPUTDATE.cmp: JS CONTROLLER:
Try Something like this, becuase there is no attribute like placholder in ui:inputdate component
I tried the above code but its not working.But my requirement is how we normally use place holder for ui:inputText i want to use like that same
You can use an input field for entering a date because there is no place holder in ui:inputDate. So to enter date in exact format you can use input field.The date format is automatically validated during the onblur event. Source Link:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_input.htm
Hope this will help you.
Regards,
Akshay