Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove mm/dd/yyyy on placeholder input type date

We have on text filed input type date .So we need placedholder so we tried like this

<input placeholder="Date" class="textbox-n" type="text" onfocus="(this.type='date')"  id="date"> 

Now it's showing placehoder "Date".Then i press it's showing mm/dd/yyyy.Then click it's showing Date box.But no need show mm/dd/yyyy .After click on textField directly open date box .Please guide to us.

like image 857
Pavan Alapati Avatar asked Jan 01 '17 07:01

Pavan Alapati


People also ask

What is the use of MM/DD/YYYY?

* 'mm/dd/yyyy' value and when valid to show the users' date of birth value. There's no way to have placeholder text on input date elements, so here's a hack for it!

How to set placeholder value for input type date in HTML 5?

How to set placeholder value for input type date in HTML 5 ? The placeholder attribute does not work with the input type Date, so place any value as a placeholder in the input type Date. You can use the onfocus=” (this.type=’date’) inside the input filed.

Can I modify the placeholder text of the date field?

But the right field is normal text input filed. Example 2: When you lose the focus on the date the date field changes back to a text field. As we can see, we can modify the placeholder text as needed.

How do I put a date inside an input file?

You can use the onfocus=” (this.type=’date’) inside the input filed. Because you are required to have a custom placeholder value for input type “date”, and you have a drop-down calendar where the user can select the date from.


1 Answers

As described in the previous discussions, you can not set the value to blank for JavaScript Date object. For more information refer to :How to initialize java.util.date to empty


However,you can set the default values to a valid date. Refer to How to set date value for more information.

like image 124
Prabir Ghosh Avatar answered Oct 11 '22 15:10

Prabir Ghosh