Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can user make input type date empty?

Tags:

html

date

input

I wish to use the new input attribute from HTML5 DATE, only one problem, in the logic of the project, the user must be have the choice to delete the value, but i don't see, how to set empty value on this inputs

like image 791
BASILIO Avatar asked Jan 26 '13 09:01

BASILIO


People also ask

How do you reset input date?

How do you reset input date? $('input[type=date]'). val(”); $('input[type=date]'). val('0000-00-00');

How do you restrict manual entry in input type date?

Approach: First, we need to write the code for input, and we need to give its type as the date in the HTML file. Then in-order to restrict the user to enter the date manually we can use onkeydown event. In the onkeydownevent we need to return false so that we can restrict the user to enter the date manually.


2 Answers

Assuming you want to make the value shown to dd/mm/yyyy, then click on Clear button.

enter image description here

like image 185
ATOzTOA Avatar answered Oct 30 '22 17:10

ATOzTOA


In HTML5 on Chrome the date picker popup has a "clear" button at the bottom (next to "today")

<input type="date" value="">
like image 4
Offbeatmammal Avatar answered Oct 30 '22 16:10

Offbeatmammal