0

is there an opportunity to change the default placeholder?

default placeholder

I already tried to change the <value="<input something>"/> and i also tried the placeholder tag but none of them worked

maybe someone can help

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
vergil_3
  • 3
  • 1
  • 4
  • Possible duplicate of [How do I simulate placeholder functionality on input date field?](https://stackoverflow.com/questions/18146350/how-do-i-simulate-placeholder-functionality-on-input-date-field) – antasp May 27 '18 at 17:03

2 Answers2

0

You can do this with CSS like below:

  input[type="date"]:before {
    content: attr(placeholder) !important;
    color: #aaa;
    margin-right: 0.5em;
  }
  input[type="date"]:focus:before,
  input[type="date"]:valid:before {
    content: "";
  }

Then in the HTML page, do like below:

<input type="date" placeholder="Choose a Date" />

The solution is taken from this StackOverflow answer: How do I simulate placeholder functionality on input date field?

Muminur Rahman
  • 575
  • 1
  • 8
  • 23
-1

A html input tag is written like this

<input type="text" name="name" placeholder="placeholder text" value="input text">

The placeholder text is only displayed when the value is empty.

antasp
  • 204
  • 1
  • 6
  • okay that's right but how do I change the "tt.mm.jjjj" to e.g. "Enter a date"? – vergil_3 May 27 '18 at 16:50
  • Sorry, I missed that you were asking about a date field. [See here](https://stackoverflow.com/questions/18146350/how-do-i-simulate-placeholder-functionality-on-input-date-field/34565565) – antasp May 27 '18 at 17:04