How to achieve placeholder/prompt for an input widget of Date Datatype?
Question
Application Type
Mobile

while working on a mobile application, I need to show a placeholder/prompt in a input widget which has a data type of DATE.

Here I need native type of calendar  to open when I click on input  instead of customized one(while using date picker, we get a customized one).

I tried to toggle the datatype through the Onfocus and Onblur events, but I don't want  to click two times on the input widget.

mvp_badge
MVP
Solution

Hi,

you can use this css -

 .DatePlace:before {
    content: attr(placeholder) !important;
    color: #aaa;
    margin-right: 0.1em;
    width: 100%;
  }
 .DatePlace:focus:before,
 .DatePlace:valid:before {
    content: "";
  }


after that add a condition on style class property of  date input widget like

If(DateVar=NullDate(),"DatePlace","form-control")


Hope this will help you.

Regards

Rahul

Hello Rahul,

It's working really fine. Thanks for your response.


Regards

Boobalan

mvp_badge
MVP

Glad to help you. Welcome :-)

Cheers

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.