<?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: Simple jQuery placeholder script for input fields</title>
	<atom:link href="http://iliadraznin.com/2010/03/simple-jquery-placeholder-script-input-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://iliadraznin.com/2010/03/simple-jquery-placeholder-script-input-fields/</link>
	<description>javascript • css • html5 &#38; ajax • art &#38; design • technology</description>
	<lastBuildDate>Sat, 04 Sep 2010 08:57:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: gren</title>
		<link>http://iliadraznin.com/2010/03/simple-jquery-placeholder-script-input-fields/comment-page-1/#comment-318</link>
		<dc:creator>gren</dc:creator>
		<pubDate>Thu, 22 Apr 2010 08:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://iliadraznin.com/?p=166#comment-318</guid>
		<description>Thanks for the script, really useful.

the test 
if ($.browser.webkit) return false;
doesn&#039;t work (and $.browser is deprecated).

So, I propose another test :

if(&#039;placeholder&#039; in document.createElement(&#039;input&#039;)) return false;

It works 
-on Firefox (placeholder not implemented by ff3.6 and test evaluated to false) 
-on Chrome and Safari (placeholder implemented and test evaluated to true)
-on IE6+ (placeholder not implemented and test evaluated to false)


see also http://diveintohtml5.org/detect.html#input-placeholder

Regards,
gren</description>
		<content:encoded><![CDATA[<p>Thanks for the script, really useful.</p>
<p>the test<br />
if ($.browser.webkit) return false;<br />
doesn’t work (and $.browser is deprecated).</p>
<p>So, I propose another test :</p>
<p>if(‘placeholder’ in document.createElement(‘input’)) return false;</p>
<p>It works<br />
–on Firefox (placeholder not implemented by ff3.6 and test evaluated to false)<br />
–on Chrome and Safari (placeholder implemented and test evaluated to true)<br />
–on IE6+ (placeholder not implemented and test evaluated to false)</p>
<p>see also <a href="http://diveintohtml5.org/detect.html#input-placeholder" rel="nofollow">http://diveintohtml5.org/detect.html#input-placeholder</a></p>
<p>Regards,<br />
gren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilia</title>
		<link>http://iliadraznin.com/2010/03/simple-jquery-placeholder-script-input-fields/comment-page-1/#comment-317</link>
		<dc:creator>Ilia</dc:creator>
		<pubDate>Sun, 11 Apr 2010 22:11:45 +0000</pubDate>
		<guid isPermaLink="false">http://iliadraznin.com/?p=166#comment-317</guid>
		<description>Great idea Brad, that gives me an idea for an even simpler solution.

The trouble with checking color is that now javascript depends on CSS, unless you go through the trouble of extracting the color value from the .placeholder class (granted, with jquery it&#039;s not much trouble, but more than necessary).

Instead of checking color we can simply check the class itself. If it&#039;s placeholder then we go ahead and clear the field (on focus), otherwise don&#039;t.

In fact, if we have that then the value doesn&#039;t need to be checked at all, it can be whatever, but if the user put it there then it&#039;s not going to have &quot;placeholder&quot; class and so is not cleared on focus.</description>
		<content:encoded><![CDATA[<p>Great idea Brad, that gives me an idea for an even simpler solution.</p>
<p>The trouble with checking color is that now javascript depends on CSS, unless you go through the trouble of extracting the color value from the .placeholder class (granted, with jquery it’s not much trouble, but more than necessary).</p>
<p>Instead of checking color we can simply check the class itself. If it’s placeholder then we go ahead and clear the field (on focus), otherwise don’t.</p>
<p>In fact, if we have that then the value doesn’t need to be checked at all, it can be whatever, but if the user put it there then it’s not going to have “placeholder” class and so is not cleared on focus.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://iliadraznin.com/2010/03/simple-jquery-placeholder-script-input-fields/comment-page-1/#comment-316</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Sun, 11 Apr 2010 21:26:21 +0000</pubDate>
		<guid isPermaLink="false">http://iliadraznin.com/?p=166#comment-316</guid>
		<description>You can also check the current color of the text to see if it needs to be erased. If it&#039;s gray, it won&#039;t be erased even if it&#039;s the same as the placeholder text.</description>
		<content:encoded><![CDATA[<p>You can also check the current color of the text to see if it needs to be erased. If it’s gray, it won’t be erased even if it’s the same as the placeholder text.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
