<?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: A Better Implementation Of The Input Prompt Pattern</title>
	<atom:link href="http://www.julienlecomte.net/blog/2009/09/314/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.julienlecomte.net/blog/2009/09/314/</link>
	<description>Web Development, Operating System Programming and Amateur Astronomy</description>
	<lastBuildDate>Wed, 03 Mar 2010 12:07:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: devsmt</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3756</link>
		<dc:creator>devsmt</dc:creator>
		<pubDate>Tue, 15 Sep 2009 15:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3756</guid>
		<description>extremely nice this creative use of markup. tnx for sharing the good idea</description>
		<content:encoded><![CDATA[<p>extremely nice this creative use of markup. tnx for sharing the good idea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rik</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3754</link>
		<dc:creator>Rik</dc:creator>
		<pubDate>Tue, 15 Sep 2009 12:42:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3754</guid>
		<description>Nice implementation for present use.

Hopefully, HTML5 will ease this behavior through the placeholder attribute (currently implemented in WebKit browsers).</description>
		<content:encoded><![CDATA[<p>Nice implementation for present use.</p>
<p>Hopefully, HTML5 will ease this behavior through the placeholder attribute (currently implemented in WebKit browsers).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dominykas</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3750</link>
		<dc:creator>Dominykas</dc:creator>
		<pubDate>Tue, 15 Sep 2009 10:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3750</guid>
		<description>As Luke says, the real problem is the autofilled values, which make things look very very very ugly. Especially if one of the fields is a password field... So, you do need to init the default values with timeout.

The label approach also has problems with positioning, since every browser has different margins/paddings for the input elements. But that can be solved with enough determination :)

Another problem is that some browsers keep the focus upon page reload/back/forward - which means that you also need to double check the hasFocus upon init to avoid changing the value of the field when the user is already about to start typing.

http://code.dominykas.com/js/hasFocus.html - focus on the input, F5 in IE. (The actual code, I think, has a bug for activeElement - can&#039;t remember if I fixed it)</description>
		<content:encoded><![CDATA[<p>As Luke says, the real problem is the autofilled values, which make things look very very very ugly. Especially if one of the fields is a password field&#8230; So, you do need to init the default values with timeout.</p>
<p>The label approach also has problems with positioning, since every browser has different margins/paddings for the input elements. But that can be solved with enough determination :)</p>
<p>Another problem is that some browsers keep the focus upon page reload/back/forward &#8211; which means that you also need to double check the hasFocus upon init to avoid changing the value of the field when the user is already about to start typing.</p>
<p><a href="http://code.dominykas.com/js/hasFocus.html" rel="nofollow">http://code.dominykas.com/js/hasFocus.html</a> &#8211; focus on the input, F5 in IE. (The actual code, I think, has a bug for activeElement &#8211; can&#8217;t remember if I fixed it)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Broyer</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3749</link>
		<dc:creator>Thomas Broyer</dc:creator>
		<pubDate>Tue, 15 Sep 2009 09:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3749</guid>
		<description>The best implementation, of course, is to rely on the browser&#039;s own implementation: [input placeholder=&quot;Search&quot;] (well, in the case of a search field, you&#039;d rather even use [input type=search placeholder=&quot;Search&quot;])

placeholder=&quot;&quot; is implemented in WebKit for a long time (which means Safari and Chrome); for others you&#039;d then rely on JavaScript to create a [label] and use your CSS positioning trick (which I concur is the best solution, compared to changing the value=&quot;&quot; attribute&#039;s value). To style the placeholder, you can use the ::-webkit-input-placeholder pseudo-element (input::-webkit-input-placeholder).

...and to detect whether placeholder=&quot;&quot; is implemented, see http://diveintohtml5.org/detect.html#input-placeholder

The only &quot;issue&quot; with placeholder=&quot;&quot; is that it isn&#039;t meant to replace [label], which you seem do be doing here: http://www.w3.org/TR/html5/forms.html#the-placeholder-attribute

Also, just wondering, couldn&#039;t you position the [label] *below* the [input] and dynamically changing the [input]&#039;s background (from transparent to white) instead of moving the [label] around? the only drawback that I can see is that as soon as you style the background you no longer have the &quot;platform&quot; styling (thin blue border on Windows for instance) and you have to style the border too.</description>
		<content:encoded><![CDATA[<p>The best implementation, of course, is to rely on the browser&#8217;s own implementation: [input placeholder="Search"] (well, in the case of a search field, you&#8217;d rather even use [input type=search placeholder="Search"])</p>
<p>placeholder=&#8221;" is implemented in WebKit for a long time (which means Safari and Chrome); for others you&#8217;d then rely on JavaScript to create a [label] and use your CSS positioning trick (which I concur is the best solution, compared to changing the value=&#8221;" attribute&#8217;s value). To style the placeholder, you can use the ::-webkit-input-placeholder pseudo-element (input::-webkit-input-placeholder).</p>
<p>&#8230;and to detect whether placeholder=&#8221;" is implemented, see <a href="http://diveintohtml5.org/detect.html#input-placeholder" rel="nofollow">http://diveintohtml5.org/detect.html#input-placeholder</a></p>
<p>The only &#8220;issue&#8221; with placeholder=&#8221;" is that it isn&#8217;t meant to replace [label], which you seem do be doing here: <a href="http://www.w3.org/TR/html5/forms.html#the-placeholder-attribute" rel="nofollow">http://www.w3.org/TR/html5/forms.html#the-placeholder-attribute</a></p>
<p>Also, just wondering, couldn&#8217;t you position the [label] *below* the [input] and dynamically changing the [input]&#8217;s background (from transparent to white) instead of moving the [label] around? the only drawback that I can see is that as soon as you style the background you no longer have the &#8220;platform&#8221; styling (thin blue border on Windows for instance) and you have to style the border too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julien Lecomte</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3745</link>
		<dc:creator>Julien Lecomte</dc:creator>
		<pubDate>Tue, 15 Sep 2009 04:26:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3745</guid>
		<description>Thanks Luke, this is very useful research!</description>
		<content:encoded><![CDATA[<p>Thanks Luke, this is very useful research!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3744</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Tue, 15 Sep 2009 04:24:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3744</guid>
		<description>Nice.  I put together something closer to the first type some time ago, but using the value modification to display example content rather than labels, leaving proper labels displayed.

It turned out, though, that I ended up spending more time dealing with the field auto fill.  It turns out that domready is too early for some browsers.  It is likely working in your case because YUI 3&#039;s async module loading spans the time before the window&#039;s onload event.

What I found was that some browsers fill the value before domready, others before window onload, and Opera (tested in 9.6, not in 10 yet) auto filled just *after* window onload.  The end result was that to reliably deal with all A grade browsers&#039; value recall, the init code needed to be executed via a short setTimeout from a window.onload subscriber.  It made me sad.

The result is here for reference: http://lucassmith.name/pub/field_default.html</description>
		<content:encoded><![CDATA[<p>Nice.  I put together something closer to the first type some time ago, but using the value modification to display example content rather than labels, leaving proper labels displayed.</p>
<p>It turned out, though, that I ended up spending more time dealing with the field auto fill.  It turns out that domready is too early for some browsers.  It is likely working in your case because YUI 3&#8217;s async module loading spans the time before the window&#8217;s onload event.</p>
<p>What I found was that some browsers fill the value before domready, others before window onload, and Opera (tested in 9.6, not in 10 yet) auto filled just *after* window onload.  The end result was that to reliably deal with all A grade browsers&#8217; value recall, the init code needed to be executed via a short setTimeout from a window.onload subscriber.  It made me sad.</p>
<p>The result is here for reference: <a href="http://lucassmith.name/pub/field_default.html" rel="nofollow">http://lucassmith.name/pub/field_default.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas C. Zakas</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3731</link>
		<dc:creator>Nicholas C. Zakas</dc:creator>
		<pubDate>Tue, 15 Sep 2009 02:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3731</guid>
		<description>I&#039;ve been trying to dissuade people from the first pattern you mention. That tends to be the easiest to implement, but also the least semantic. I really like the second pattern, I think that makes the most sense since the text visibly inside of the textbox really does act like a label. Thanks for sharing the better approach. :)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been trying to dissuade people from the first pattern you mention. That tends to be the easiest to implement, but also the least semantic. I really like the second pattern, I think that makes the most sense since the text visibly inside of the textbox really does act like a label. Thanks for sharing the better approach. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete B</title>
		<link>http://www.julienlecomte.net/blog/2009/09/314/comment-page-1/#comment-3714</link>
		<dc:creator>Pete B</dc:creator>
		<pubDate>Mon, 14 Sep 2009 20:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.julienlecomte.net/blog/?p=314#comment-3714</guid>
		<description>I was just writing one of these yesterday, and used an html 5 custom data attribute named &#039;data-hint&#039;. 

This has the advantage that you can define the hint as independent of the label text.

I also tested and rejected whitespace only values, but that may be a little ott.</description>
		<content:encoded><![CDATA[<p>I was just writing one of these yesterday, and used an html 5 custom data attribute named &#8216;data-hint&#8217;. </p>
<p>This has the advantage that you can define the hint as independent of the label text.</p>
<p>I also tested and rejected whitespace only values, but that may be a little ott.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
