<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Put the Clear Button Back in Datepicker</title>
	<atom:link href="http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/</link>
	<description>headcheese and mukluks</description>
	<lastBuildDate>Fri, 03 Feb 2012 05:02:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dylan</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-84</link>
		<dc:creator>Dylan</dc:creator>
		<pubDate>Fri, 03 Feb 2012 05:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-84</guid>
		<description>Thanks Sayed, that worked well.
Only change was to only use event.which == 8 for the delete key since backspace caused IE8 to navigate back (making it pointless.)
Cheers.</description>
		<content:encoded><![CDATA[<p>Thanks Sayed, that worked well.<br />
Only change was to only use event.which == 8 for the delete key since backspace caused IE8 to navigate back (making it pointless.)<br />
Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sayed</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-57</link>
		<dc:creator>Sayed</dc:creator>
		<pubDate>Sun, 13 Feb 2011 15:40:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-57</guid>
		<description>I solved the issue of clearing read-only date fields by adding a keydown trigger(keypress doesn&#039;t work with delete and backspace keys):

$(&quot;#datefld&quot;).keydown(function(event) 
                    {
                        //if &quot;backspace&quot; or &quot;delete&quot; key pressed...
                        if (event.which == 8 &#124;&#124; event.which == 46)
                        {
                            $(this).val(&quot;&quot;);   
                        }
                    }
                );</description>
		<content:encoded><![CDATA[<p>I solved the issue of clearing read-only date fields by adding a keydown trigger(keypress doesn&#8217;t work with delete and backspace keys):</p>
<p>$(&#8220;#datefld&#8221;).keydown(function(event)<br />
                    {<br />
                        //if &#8220;backspace&#8221; or &#8220;delete&#8221; key pressed&#8230;<br />
                        if (event.which == 8 || event.which == 46)<br />
                        {<br />
                            $(this).val(&#8220;&#8221;);<br />
                        }<br />
                    }<br />
                );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-55</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Thu, 27 Jan 2011 15:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-55</guid>
		<description>I agree wholeheartedly with the above! The clear button is an absolute must.

The so called work around that has been suggested by Scott (http://bugs.jqueryui.com/ticket/3999#comment:10) is a fail, because the button disappears after you navigate between months.

It should be easily possible to add this button back to the datepicker, but simply display it only when a certain configuration flag is set to true.

Are the folks at jQuery really that ignorant? I find that hard to believe given what they are capable of making.</description>
		<content:encoded><![CDATA[<p>I agree wholeheartedly with the above! The clear button is an absolute must.</p>
<p>The so called work around that has been suggested by Scott (<a href="http://bugs.jqueryui.com/ticket/3999#comment:10" rel="nofollow">http://bugs.jqueryui.com/ticket/3999#comment:10</a>) is a fail, because the button disappears after you navigate between months.</p>
<p>It should be easily possible to add this button back to the datepicker, but simply display it only when a certain configuration flag is set to true.</p>
<p>Are the folks at jQuery really that ignorant? I find that hard to believe given what they are capable of making.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-41</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Mon, 13 Dec 2010 18:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-41</guid>
		<description>Well, 1.8.7 is out and apparently they did not add the Clear button back in, or I cant find the functionality....</description>
		<content:encoded><![CDATA[<p>Well, 1.8.7 is out and apparently they did not add the Clear button back in, or I cant find the functionality&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JM</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-38</link>
		<dc:creator>JM</dc:creator>
		<pubDate>Mon, 07 Jun 2010 12:36:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-38</guid>
		<description>I would also like a clear button, preferably configurable to appear or not.

Concerning the client/server side validation of the date: My approach has always been, and will always be, that while client-side validation is convenient for the user, you should always validate server-side too, and be prepared to handle any errors generated there. Never rely exclusively on client-side scripts for data validation.</description>
		<content:encoded><![CDATA[<p>I would also like a clear button, preferably configurable to appear or not.</p>
<p>Concerning the client/server side validation of the date: My approach has always been, and will always be, that while client-side validation is convenient for the user, you should always validate server-side too, and be prepared to handle any errors generated there. Never rely exclusively on client-side scripts for data validation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hubert</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-27</link>
		<dc:creator>Hubert</dc:creator>
		<pubDate>Mon, 15 Mar 2010 14:12:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-27</guid>
		<description>Great blog.

Same here. Please bring back the clear button! Any workarounds? Thanks.</description>
		<content:encoded><![CDATA[<p>Great blog.</p>
<p>Same here. Please bring back the clear button! Any workarounds? Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-26</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 23 Feb 2010 21:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-26</guid>
		<description>Does anyone have some example code showing how to add a clear button?

I think its a little ridiculous that the jQuery UI people don&#039;t think its necessary.

Its a common use case I&#039;ve seen many many times: The server requires dates in a specific format.  So the field is set to read only, forcing the user to use the date picker.  But once they select a date they can&#039;t clear it!  I am having issues now in several areas of our site because user&#039;s can&#039;t clear the date.  We have many search forms that use dates, sometimes they put in a date but later want to pull it out after doing several searches.  Right now they have to refresh the whole page, loosing all their other search criteria.</description>
		<content:encoded><![CDATA[<p>Does anyone have some example code showing how to add a clear button?</p>
<p>I think its a little ridiculous that the jQuery UI people don&#8217;t think its necessary.</p>
<p>Its a common use case I&#8217;ve seen many many times: The server requires dates in a specific format.  So the field is set to read only, forcing the user to use the date picker.  But once they select a date they can&#8217;t clear it!  I am having issues now in several areas of our site because user&#8217;s can&#8217;t clear the date.  We have many search forms that use dates, sometimes they put in a date but later want to pull it out after doing several searches.  Right now they have to refresh the whole page, loosing all their other search criteria.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charliefortune</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-20</link>
		<dc:creator>charliefortune</dc:creator>
		<pubDate>Thu, 01 Oct 2009 12:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-20</guid>
		<description>Hi - I am also using a readonly field as a form of frontline validation. Only allowing the datePicker to fill the field enforces the format and the validity of the dates. I too would like the clear button, guess I will be adding my own..</description>
		<content:encoded><![CDATA[<p>Hi &#8211; I am also using a readonly field as a form of frontline validation. Only allowing the datePicker to fill the field enforces the format and the validity of the dates. I too would like the clear button, guess I will be adding my own..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ole Jørgensen</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-14</link>
		<dc:creator>Ole Jørgensen</dc:creator>
		<pubDate>Tue, 14 Apr 2009 13:28:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-14</guid>
		<description>Hi
I use an altField and altFormat on a hidden field. The altFormat is simple &#039;dd/mm/yy&#039; - independent of i18n. The visible format has written month name: &#039;dd M yy&#039;. I use the altField on server side. 
Problem is that when user clear the visible field, the alt field still has the old value. So the altField can not be cleared.</description>
		<content:encoded><![CDATA[<p>Hi<br />
I use an altField and altFormat on a hidden field. The altFormat is simple &#8216;dd/mm/yy&#8217; &#8211; independent of i18n. The visible format has written month name: &#8216;dd M yy&#8217;. I use the altField on server side.<br />
Problem is that when user clear the visible field, the alt field still has the old value. So the altField can not be cleared.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/comment-page-1/#comment-12</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Thu, 26 Mar 2009 17:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.unthunk.com/?p=42#comment-12</guid>
		<description>Hi lucas.  I didn&#039;t see you followup over at the wiki http://wiki.jqueryui.com/DatePickerCalendar

I&#039;m posting here because I rather not create an account to login over there.  Kindly add my comments if you add a wiki comment.

I&#039;m here today because I&#039;m looking for a date picker with a clear button and found your site.  Currently I have pages with a separate button/icon to clear the date.  It looks fine on those pages, but now I will have to make the icons smaller for pages where the icon should be the size of the date text.  It could be a non-issue if the date picker allowed the user to REMOVE a date picked in error while maintaining validated entries for correct dates.

Allowing the user to click into the field to clear the text is a fine thought, but it also allows them to input dates in a format I do not want; or totally invalid dates unless I add client-side validation.

I use read-only text fields so that the user can&#039;t enter an invalid date.  If you go to http://jqueryui.com/demos/datepicker/ you can enter an invalid &quot;date&quot; like 444/44/444444 and tab out of the field.  Read-only saves client-side date validation.  (Actually on some pages, I don&#039;t even display a text field.  It looks like normal text; then you double-click on it; then a calendar appears then a date is selected (I wish it could also be cleared); when the calendar closes, the text looks like inline normal ([read-only] date) text again.

My workaround seems to be that I will have to provide smaller icons.  Their goal seems to be visual clarity (which I think is better placed in the large popup calendar than inline with a small or oversized icon).  I&#039;ll just be helping the Optometrists.</description>
		<content:encoded><![CDATA[<p>Hi lucas.  I didn&#8217;t see you followup over at the wiki <a href="http://wiki.jqueryui.com/DatePickerCalendar" rel="nofollow">http://wiki.jqueryui.com/DatePickerCalendar</a></p>
<p>I&#8217;m posting here because I rather not create an account to login over there.  Kindly add my comments if you add a wiki comment.</p>
<p>I&#8217;m here today because I&#8217;m looking for a date picker with a clear button and found your site.  Currently I have pages with a separate button/icon to clear the date.  It looks fine on those pages, but now I will have to make the icons smaller for pages where the icon should be the size of the date text.  It could be a non-issue if the date picker allowed the user to REMOVE a date picked in error while maintaining validated entries for correct dates.</p>
<p>Allowing the user to click into the field to clear the text is a fine thought, but it also allows them to input dates in a format I do not want; or totally invalid dates unless I add client-side validation.</p>
<p>I use read-only text fields so that the user can&#8217;t enter an invalid date.  If you go to <a href="http://jqueryui.com/demos/datepicker/" rel="nofollow">http://jqueryui.com/demos/datepicker/</a> you can enter an invalid &#8220;date&#8221; like 444/44/444444 and tab out of the field.  Read-only saves client-side date validation.  (Actually on some pages, I don&#8217;t even display a text field.  It looks like normal text; then you double-click on it; then a calendar appears then a date is selected (I wish it could also be cleared); when the calendar closes, the text looks like inline normal ([read-only] date) text again.</p>
<p>My workaround seems to be that I will have to provide smaller icons.  Their goal seems to be visual clarity (which I think is better placed in the large popup calendar than inline with a small or oversized icon).  I&#8217;ll just be helping the Optometrists.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

