<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unthunk &#187; jquery</title>
	<atom:link href="http://blog.unthunk.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unthunk.com</link>
	<description>headcheese and mukluks</description>
	<lastBuildDate>Fri, 22 Jul 2011 14:01:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Put the Clear Button Back in Datepicker</title>
		<link>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/</link>
		<comments>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 02:52:01 +0000</pubDate>
		<dc:creator>lucas</dc:creator>
				<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.unthunk.com/?p=42</guid>
		<description><![CDATA[As jQuery UI rapidly approaches version 1.6 (currently release candidate 6), a list of some of the changes underway can be found on the jQuery UI Development &#038; Planning Wiki. It will continue to offer a fantastic array of widgets, &#8230; <a href="http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As jQuery UI rapidly approaches version 1.6 (currently <a href="http://blog.jquery.com/2009/01/30/jquery-ui-16rc6-help-us-test/">release candidate 6</a>), a list of some of the changes underway can be found on the <a href="http://jqueryui.pbwiki.com/DatePickerCalendar">jQuery UI Development &#038; Planning Wiki</a>.  It will continue to offer a <a href="http://ui.jquery.com/demos/">fantastic array of widgets, interactions, and effects</a> as well as <a href="http://ui.jquery.com/themeroller/">themeroller</a>, an awesome tool for creating custom UI themes.  However, dig into the wiki and you will find a list of thing being removed, including the clear button in Datepicker:</p>
<p><cite>&#8220;clear&#8221; button &#8211; 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&#8217;s best to encourage users to pick a date, not clear the field.</cite></p>
<p>I think both of the last two statements are presumptive.  Yes, an empty date field might be invalid, but it can also be perfectly acceptable.  For example, a form may have start and end date fields.  On the back-end, if there are valid dates in both fields, then all data within this date range would be returned: Show me all foo between two specified dates.  However, leaving one or both of these fields blank may signify an open-ended search: Show me all foo up until the end date, or, show me all the foo since the start date, or, show me the foo!!!  The back-end should absolutely be validating form data.  It&#8217;s best to allow users to pick any data valid for a given field.  I don&#8217;t have a problem with the front-end doing additional validation. I think allow developers a mechanism via Datepicker to choose what values are valid would be a better idea than assuming and empty field might be invalid.</p>
<p>As far as the first statement, <a href="http://dev.jqueryui.com/ticket/3999">not having a clear button makes it impossible to remove a date from a readonly field</a>.  Datepicker can easily set a readonly field but not clear it.  So why would you want to change a readonly field?  Despite the fact that the web has become ubiquitous, many people still are in the habit of double-clicking everything: hyperlinks, inputs, buttons, etc.  Couple this with web browsers that keep previously entered values in input boxes and you end up with date fields that display Datepicker on the first click of a double-click and then a list of previously entered values over the top of Datepicker on the second click of the double-click.  Setting an input to readonly prevents the history from appearing on a double-click and thus from interfering with Datepicker.  Now, this could possibly be a semantic no-no and a violation of accessibility, but it does happen.  Having a clear button makes it possible to clear a readonly field.</p>
<p>Datepicker is part of jQuery UI: it is a user interface for dealing with date fields.  Whatever a user can validly do with a date field, Datepicker should provide a useful interface for doing so.  Put the clear button back!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unthunk.com/2009/02/09/put-the-clear-button-back-in-datepicker/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

