Skip to main content

Search and Top Navigation

#3999 closed enhancement (wontfix)

Opened January 30, 2009 09:37AM UTC

Closed September 30, 2010 05:10PM UTC

Last modified September 18, 2013 06:17PM UTC

Datepicker: Add clear button

Reported by: jain.ashish21 Owned by:
Priority: minor Milestone: 1.6
Component: ui.datepicker Version: 1.6rc5
Keywords: clear button Cc: jain.ashish21@gmail.com
Blocked by: Blocking:
Description

The clear button and functionality were removed from UI 1.6 rc1+ onwards. But this makes it impossible to clear the existing date, if any, when the control is readonly.

Attachments (0)
Change History (27)

Changed February 12, 2009 11:43PM UTC by jzaefferer comment:1

milestone: TBD1.next

Could you explain the usecase for this?

Changed February 21, 2009 12:12AM UTC by NVRAM comment:2

IIUC, when using: '''showOn:'both'''' there is no way for a user to erase the value and specify ''no date'' with a blank entry.

But there might be a method I missed, in my case (1.6rc6) I switched to '''showOn:'button''''

Changed May 26, 2009 03:15PM UTC by m2x comment:3

Replying to [comment:1 joern.zaefferer]:

Could you explain the usecase for this?

example usecase is clearing a date when input field is readonly (the reason for doing it readonly as here: http://dev.jqueryui.com/ticket/4079#comment:3)

Changed November 09, 2009 08:19PM UTC by boteeka comment:4

Clear functionality is definitely needed. I spent half a day Googling and trying to find some workaround to clear the selected dates. Without this functionality there is no way I can reset the form, and I think this is a serious shortcoming.

Please add this functionality, as it seems a lot of people need it.

Changed February 23, 2010 08:54PM UTC by zirconx comment:5

I would really like to see this feature added, too. I might have to switch to a different calendar that supports this.

I've seen some discussion that this feature isn't needed because the user can just clear the field - NOT TRUE. On most of the sites I've worked on that use a date picker the field is READ ONLY. Often times the server expects the date in a certain format so the user isn't allowed to just type in whatever they want - instead they are forced to use the date picker. So we need a clear option please. :-)

Changed April 26, 2010 01:25PM UTC by maderic_m comment:6

I think it is necessary to implement this option, given that the field is read only once you enter a date can not be erased, thanks

Changed May 06, 2010 11:53AM UTC by boomyjee comment:7

here is my solution, you can use done button as clear with the following hack

$(".datepicker").datepicker({

showButtonPanel: true,

closeText: 'Clear',

});

$.datepicker._generateHTML_Old = $.datepicker._generateHTML;

$.datepicker._generateHTML = function(inst) {

res = this._generateHTML_Old(inst);

res = res.replace("_hideDatepicker()","_clearDate('#"+inst.id+"')");

return res;

}

Changed July 31, 2010 09:49AM UTC by keir comment:8

I created a fork of jquery which supports the clear option. You have to enable the button bar and also add { showClearButton : true } to the options.

http://github.com/keir/jquery-ui/commit/25e55ff73df768360a2260534a4afa6e03f04fb

I sent a pull request to the jquery-ui maintainers; hopefully they will reconsider the removal of this feature and merge my pull request.

Changed September 01, 2010 08:31PM UTC by jbcoder2 comment:9

Replying to [comment:1 joern.zaefferer]:

Could you explain the usecase for this?

Using 2 DatePicker that are tied together to define a date range.

Clearing the text from either text input does not clear the date in the underlying DatePicker object or the restrictions that are imposed by the previously selected date.

Changed September 22, 2010 01:34PM UTC by scottgonzalez comment:10

summary: Clear button and functionality removedDatepicker: Add clear button
type: bugenhancement

Proof of concept for adding a clear button without modifying the existing datepicker: http://jsbin.com/ofare/edit

Changed September 30, 2010 04:21PM UTC by pfurbacher comment:11

Use case: the input field is read-only. We had to do this because validating users' typed date input became a headache in legacy code. Using the calendar, triggered by clicking on either the input or an icon button, solved the issue in a matter of minutes. However, users want the ability to clear the date field via the pop-up. The alternative is to add a "clear" button next to the calendar's icon button.

Changed September 30, 2010 05:10PM UTC by scottgonzalez comment:12

resolution: → wontfix
status: newclosed

See my comment above about making an extension.

Changed January 27, 2011 03:19PM UTC by Ildefonse comment:13

@ scott.gonzalez

Your proof of concept at http://jsbin.com/ofare/edit has a major shortcoming. The clear button disappears when you navigate to different months.

Why is it not possible to add the clear button back to the datepicker, so that we can enable it with a setting like showClear?

A quick google search shows that there are many people out there that want this. And there are plenty of cases where this could be useful.

Changed June 11, 2011 05:41PM UTC by SOCAR comment:14

Hi!

I have modified scott.gonzalez version a little bit. Sacrificing the "done" button, I might say that this works for me: http://jsbin.com/unude4/5/edit and does not loose the clean filter functionality after changing month etc.

best regards

Changed August 02, 2011 03:17PM UTC by IMSoP comment:15

Hi, sorry to add a "me too" comment here, but I'm not clear on the rationale for closing this wontfix; lack of use cases was mentioned, but plenty have been provided here and elsewhere (e.g comments on http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/)

The suggestion of adding as an extension using the "beforeShow" event is not a valid workaround, as Ildefonse points out, because this event is not called when the calendar is redrawn. There would appear to be no way of adding this feature without patching the code unless an extra event or option is added.

This seems to be a widely requested feature, for which two patches have been submitted (https://github.com/softlab/jquery-ui/commit/4b1f53484df317ec889bf16013a667b6a09248ac and https://github.com/keir/jquery-ui/commit/25e55ff73df768360a2260534a4afa6e03f04fb). Are these patches not acceptable, or just stale?

Sorry to be a whinging user, but a clearer explanation of the situation would be very welcome.

Thanks for all your hard work,

Rowan

Changed August 02, 2011 03:59PM UTC by scottgonzalez comment:16

Replying to [comment:15 IMSoP]:

Hi, sorry to add a "me too" comment here, but I'm not clear on the rationale for closing this wontfix; lack of use cases was mentioned, but plenty have been provided here and elsewhere (e.g comments on http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/)

Actually, in that post Lucas even questions the validity of his own use case. Then later in the comments there's a clear explanation from Scott Jehl about how the use case is essentially an abuse of HTML. Not to mention the use case was pretty much "my boss uses the web wrong" (and you can turn off autocomplete).

Changed August 03, 2011 05:44PM UTC by IMSoP comment:17

Replying to [comment:16 scott.gonzalez]:

Actually, in that post Lucas even questions the validity of his own use case. Then later in the comments there's a clear explanation from Scott Jehl about how the use case is essentially an abuse of HTML. Not to mention the use case was pretty much "my boss uses the web wrong" (and you can turn off autocomplete).

I specifically referred to the comments on that blog post, in which several people put forward different use cases. Most compelling to me is that if you use the altField option, the argument that you can clear the text-field with the keyboard does not apply; if altField is supported, there should be a method of clearing that field. Other related scenarios are when the calendar widget is compulsory - i.e. the input field is a read-only display, so that the user cannot enter invalid values.

Changed August 29, 2011 08:00PM UTC by timothy.morgan3@googlemail.com comment:18

_comment0: Replying to [comment:7 boomyjee]: \ > here is my solution, you can use done button as clear with the following hack \ > \ > $(".datepicker").datepicker({ \ > showButtonPanel: true, \ > closeText: 'Clear', \ > }); \ > \ > $.datepicker._generateHTML_Old = $.datepicker._generateHTML; \ > $.datepicker._generateHTML = function(inst) { \ > res = this._generateHTML_Old(inst); \ > res = res.replace("_hideDatepicker()","_clearDate('#"+inst.id+"')"); \ > return res; \ > } \ \ Here's a slightly less intrusive version of this hack, which actually adds a seperate clear button. Although it's not configurable in the options; you could of course extend a new datepicker and add the override to that instead, if needs be. Note that I too am suffering from the read-only use case. \ \ $(function(){ \ //wrap up the redraw function with our new shiz \ var dpFunc = $.datepicker._generateHTML; //record the original \ $.datepicker._generateHTML = function(inst){ \ var thishtml = $( dpFunc.call($.datepicker, inst) ); //call the original \ \ thishtml = $('<div />').append(thishtml); //add a wrapper div for jQuery context \ \ //locate the button panel and add our button - with a custom css class. \ $('.ui-datepicker-buttonpane', thishtml).append( \ $('<button class="\\ \ ui-datepicker-clear ui-state-default ui-priority-primary ui-corner-all\\ \ "\\>Clear</button>' \ ).click(function(){ \ inst.input.attr('value', ''); \ inst.input.datepicker('hide'); \ }) \ ); \ \ thishtml = thishtml.children(); //remove the wrapper div \ \ return thishtml; //assume okay to return a jQuery \ }; \ });1314648103812795
_comment1: Replying to [comment:7 boomyjee]: \ > here is my solution, you can use done button as clear with the following hack \ > \ > $(".datepicker").datepicker({ \ > showButtonPanel: true, \ > closeText: 'Clear', \ > }); \ > \ > $.datepicker._generateHTML_Old = $.datepicker._generateHTML; \ > $.datepicker._generateHTML = function(inst) { \ > res = this._generateHTML_Old(inst); \ > res = res.replace("_hideDatepicker()","_clearDate('#"+inst.id+"')"); \ > return res; \ > } \ \ Here's a slightly less intrusive version of this hack, which actually adds a seperate clear button. Although it's not configurable in the options; you could of course extend a new datepicker and add the override to that instead, if needs be. Note that I too am suffering from the read-only use case. \ \ \ {{{ \ $(function(){ \ //wrap up the redraw function with our new shiz \ var dpFunc = $.datepicker._generateHTML; //record the original \ $.datepicker._generateHTML = function(inst){ \ var thishtml = $( dpFunc.call($.datepicker, inst) ); //call the original \ \ thishtml = $('<div />').append(thishtml); //add a wrapper div for jQuery context \ \ //locate the button panel and add our button - with a custom css class. \ $('.ui-datepicker-buttonpane', thishtml).append( \ $('<button class="\\ \ ui-datepicker-clear ui-state-default ui-priority-primary ui-corner-all\\ \ "\\>Clear</button>' \ ).click(function(){ \ inst.input.attr('value', ''); \ inst.input.datepicker('hide'); \ }) \ ); \ \ thishtml = thishtml.children(); //remove the wrapper div \ \ return thishtml; //assume okay to return a jQuery \ }; \ }); \ }}}1314648218521821
_comment2: Replying to [comment:7 boomyjee]: \ > here is my solution, you can use done button as clear with the following hack \ > \ > $(".datepicker").datepicker({ \ > showButtonPanel: true, \ > closeText: 'Clear', \ > }); \ > \ > $.datepicker._generateHTML_Old = $.datepicker._generateHTML; \ > $.datepicker._generateHTML = function(inst) { \ > res = this._generateHTML_Old(inst); \ > res = res.replace("_hideDatepicker()","_clearDate('#"+inst.id+"')"); \ > return res; \ > } \ \ \ Here's a slightly less intrusive version of this hack, which actually adds a seperate clear button. Although it's not configurable in the options, you could of course extend a new datepicker and add the override to that instead, if needs be. Note that I too am suffering from the read-only use case. \ \ \ {{{ \ $(function(){ \ //wrap up the redraw function with our new shiz \ var dpFunc = $.datepicker._generateHTML; //record the original \ $.datepicker._generateHTML = function(inst){ \ var thishtml = $( dpFunc.call($.datepicker, inst) ); //call the original \ \ thishtml = $('<div />').append(thishtml); //add a wrapper div for jQuery context \ \ //locate the button panel and add our button - with a custom css class. \ $('.ui-datepicker-buttonpane', thishtml).append( \ $('<button class="\\ \ ui-datepicker-clear ui-state-default ui-priority-primary ui-corner-all\\ \ "\\>Clear</button>' \ ).click(function(){ \ inst.input.attr('value', ''); \ inst.input.datepicker('hide'); \ }) \ ); \ \ thishtml = thishtml.children(); //remove the wrapper div \ \ return thishtml; //assume okay to return a jQuery \ }; \ }); \ }}}1314648865464504

Replying to [comment:7 boomyjee]:

here is my solution, you can use done button as clear with the following hack $(".datepicker").datepicker({ showButtonPanel: true, closeText: 'Clear', }); $.datepicker._generateHTML_Old = $.datepicker._generateHTML; $.datepicker._generateHTML = function(inst) { res = this._generateHTML_Old(inst); res = res.replace("_hideDatepicker()","_clearDate('#"+inst.id+"')"); return res; }

Here's a slightly less intrusive version of this hack, which actually adds a seperate clear button. Although it's not configurable in the options, you could of course extend a new datepicker and add the override to that instead, if needs be. Note that I too am suffering from the read-only use case.

(works with jquery-ui-1.8.15)

$(function(){
	//wrap up the redraw function with our new shiz
	var dpFunc = $.datepicker._generateHTML; //record the original
	$.datepicker._generateHTML = function(inst){
		var thishtml = $( dpFunc.call($.datepicker, inst) ); //call the original
		
		thishtml = $('<div />').append(thishtml); //add a wrapper div for jQuery context
		
		//locate the button panel and add our button - with a custom css class.
		$('.ui-datepicker-buttonpane', thishtml).append(
			$('<button class="\\
				ui-datepicker-clear ui-state-default ui-priority-primary ui-corner-all\\
				"\\>Clear</button>'
			).click(function(){
				inst.input.attr('value', '');
				inst.input.datepicker('hide');
			})
		);
		
		thishtml = thishtml.children(); //remove the wrapper div
		
		return thishtml; //assume okay to return a jQuery
	};
});

Changed August 30, 2011 02:11PM UTC by IMSoP comment:19

Replying to [comment:18 timothy.morgan3@…]:

Here's a slightly less intrusive version of this hack, which actually adds a seperate clear button...

I haven't had a chance to test it yet, but that looks like a reasonable approach for a workaround if the maintainers won't accept a patch. I think it would be better to use

 _clearDate('#"+inst.id+"') 
rather than
 inst.input.attr('value', ''); 
if possible, as this will fire additional triggers, such as clearing the altField.

Changed September 05, 2011 05:09AM UTC by kounterfeit comment:20

_comment0: So....How about this use case, where would you backspace?? Oh ... no-where?? Really?!??! \ \ I really dont understand why this was removed and hasn't been brought back even when there have been several requests over the last few years to bring it back with many acceptable use cases. \ \ Is the jQuery UI team suggesting I change my whole UI? \ \ [[Image(http://www.integratedweb.com.au/where-to-put-button.png)]] \ \ How's the above screen shot for a practical use case? \ \ I can't see why if it was an option, people who didn't want it could just disable it? Instead of removing ALL functionality in one hit and saying "Oh, you had a practical use case? We don't care."1315199432742930

So....How about this use case, where would you backspace?? Oh ... no-where?? Really?!??!

I really dont understand why this was removed and hasn't been brought back even when there have been several requests over the last few years to bring it back with many acceptable use cases.

Is the jQuery UI team suggesting I change my whole UI?

(( SCREENSHOT REMOVED, TOP SECRET ))

How's the above screen shot for a practical use case?

I can't see why if it was an option, people who didn't want it could just disable it? Instead of removing ALL functionality in one hit and saying "Oh, you had a practical use case? We don't care."

Changed June 14, 2012 04:59PM UTC by Tiggrstaar comment:21

_comment0: One quick way you can add the clear feature even on read only fields is to add the following code to your existing datepicker control: \ \ }).keyup(function(e) { \ if(e.keyCode == 8 || e.keyCode == 46) { \ $.datepicker._clearDate(this); \ } \ }); \ \ This will enable people to highlight(which they can even on RO fields) and then use the backspace or delete to remove the date using the internal _clearDate function.1339693242345047

One quick way you can add the clear feature even on read only fields is to add the following code to your existing datepicker control:


	}).keyup(function(e) {
		if(e.keyCode == 8 || e.keyCode == 46) {
			$.datepicker._clearDate(this);
		}
	});

This will enable people to highlight(which they can even on RO fields) and then use the backspace or delete to remove the date using the internal _clearDate function.

Changed October 03, 2012 04:53PM UTC by scottgonzalez comment:22

milestone: 1.next1.6

Changed January 10, 2013 02:35PM UTC by kwutzke comment:23

OMG, why isn't this functionality available? It IS necessary for calendars with associated inputs that cannot be typed to. Don't ask me, but sometimes such requirements exist, so jQuery should (MUST!) support this.

You make everybody using jQuery (and PrimeFaces etc.) fiddle with workarounds. Very undesirable. Please reopen.

Changed January 22, 2013 10:39AM UTC by martin.meridius comment:24

Seriously, this is a hugely missed feature!

Please reconsider opening this enahancement as this way the only chance for us is to use hack by Tiggrstaar from comment 21 (thank you), and the user has to remember to press backspace/delete instead of just clicking the button.

Changed February 09, 2013 10:30PM UTC by hybris comment:25

_comment0: "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ It is the reasonable thought behind the removing of the clear button. \ \ Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think and write to the right date format we want. \ \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ ''' The best is to encourage users to not use the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch and by click too.''' \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449097299673
_comment1: "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ It is the reasonable thought behind the removing of the clear button. \ \ Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (anc to write it) \ \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ ''' The best is to encourage users to not use the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch and by click too.''' \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449111973051
_comment2: "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ It is the reasonable thought behind the removing of the clear button. \ \ Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and to write it) \ \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ ''' The best is to encourage users to not use the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch and by click too.''' \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449379833353
  • double post, sorry

Changed February 09, 2013 10:32PM UTC by hybris comment:26

_comment0: Replying to [comment:25 hybris]: \ > "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ > It is the reasonable thought behind the removing of the clear button. \ > \ > Not all fields are required. Asuming an empty field might be invalid is wrong! \ > \ > "a user can simply clear out the field value manually" \ > It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ > \ > Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and to write it) \ > \ > "It’s best to encourage users to pick a date, not clear the field." (?!) \ > ''' The best is to encourage users to not use the date input field manually at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch and by click too.''' \ > \ > It is better to let the developers choose what is invalid field or not :) \ > \ > The clear option should be part of the datepicker. \ 1360449295164817
_comment1: "clear” button – seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." that is the reasonable thought behind the removing. \ \ Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and let the user free to write it). \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ The best is to encourage users to not use manually the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date too. \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449345815255
_comment2: seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." that is the reasonable thought behind the removing. \ \ Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and let the user free to write it). \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ The best is to encourage users to not use manually the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date too. \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449445785554
_comment3: "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ that is the reasonable thought behind the removing. Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and let the user free to write it). \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ '''The best is to encourage users to not use manually the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date too.''' \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449495430427
_comment4: "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ that is the reasonable thought behind the removing. Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and let the user free to write it). \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ '''The best is to encourage users to not use manually the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch or by click''' \ \ It is better to let the developers choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449552208415
_comment5: "seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field." \ that is the reasonable thought behind the removing. Not all fields are required. Asuming an empty field might be invalid is wrong! \ \ "a user can simply clear out the field value manually" \ It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar. \ \ Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and let the user free to write it). \ "It’s best to encourage users to pick a date, not clear the field." (?!) \ '''The best is to encourage users to not use manually the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch or by click''' \ \ It is better to let us choose what is invalid field or not :) \ \ The clear option should be part of the datepicker.1360449575542682

"seems like overkill since a user can simply clear out the field value manually. Plus, clearing the input would make the input invalid if the field is required. It’s best to encourage users to pick a date, not clear the field."

that is the reasonable thought behind the removing. Not all fields are required. Asuming an empty field might be invalid is wrong!

"a user can simply clear out the field value manually"

It is not a good usable choice, while a user clears out the input, the calendar can be an obstruction, the input sometimes might be covered by the calendar.

Most of us use the calendar to avoid wrong format type and it is very important don't let the user think about the right date format we want (and let the user free to write it).

"It’s best to encourage users to pick a date, not clear the field." (?!)

The best is to encourage users to not use manually the date input field at all. So, since they can choose a date by touch or by click, they shoud be able to clear the date by touch or by click

It is better to let us choose what is an invalid field or not :)

The clear option should be part of the datepicker.

Changed September 18, 2013 06:17PM UTC by jayknight comment:27

This simple plugin can add a clear button to any field (not just dates): https://github.com/jk3us/jquery-clearable.