<?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: how to add placeholder attributes in Silverstripe Userforms Module	</title>
	<atom:link href="https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Thu, 02 Oct 2014 17:02:25 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Jose Bedoya		</title>
		<link>https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-166271</link>

		<dc:creator><![CDATA[Jose Bedoya]]></dc:creator>
		<pubDate>Thu, 02 Oct 2014 17:02:25 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=2160#comment-166271</guid>

					<description><![CDATA[In Configuration Tab just check Hide field labels option.]]></description>
			<content:encoded><![CDATA[<p>In Configuration Tab just check Hide field labels option.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: IHeartMoon		</title>
		<link>https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-79255</link>

		<dc:creator><![CDATA[IHeartMoon]]></dc:creator>
		<pubDate>Tue, 01 Jul 2014 10:20:38 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=2160#comment-79255</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-75190&quot;&gt;IHeartMoon&lt;/a&gt;.

No nevermind, Tim&#039;s fix worked! 
My Bad :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-75190">IHeartMoon</a>.</p>
<p>No nevermind, Tim&#8217;s fix worked!<br />
My Bad :)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: IHeartMoon		</title>
		<link>https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-75190</link>

		<dc:creator><![CDATA[IHeartMoon]]></dc:creator>
		<pubDate>Thu, 26 Jun 2014 13:09:42 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=2160#comment-75190</guid>

					<description><![CDATA[This is nice but it&#039;s true about checkbox text disappearing. For instance the &quot;Remember me next time?&quot; text for the checkbox on the login page disappears.
It&#039;s also a bit jumpy. I can see the label load outside before it&#039;s removed and goes in as a placeholder.

I played around with the .not(&#039;[type=checkbox]&#039;) but couldn&#039;t get it to work properly]]></description>
			<content:encoded><![CDATA[<p>This is nice but it&#8217;s true about checkbox text disappearing. For instance the &#8220;Remember me next time?&#8221; text for the checkbox on the login page disappears.<br />
It&#8217;s also a bit jumpy. I can see the label load outside before it&#8217;s removed and goes in as a placeholder.</p>
<p>I played around with the .not(&#8216;[type=checkbox]&#8217;) but couldn&#8217;t get it to work properly</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tobi		</title>
		<link>https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-20713</link>

		<dc:creator><![CDATA[Tobi]]></dc:creator>
		<pubDate>Mon, 14 Apr 2014 15:41:40 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=2160#comment-20713</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-18041&quot;&gt;Tim&lt;/a&gt;.

Thank you! This was really helpful!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-18041">Tim</a>.</p>
<p>Thank you! This was really helpful!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim		</title>
		<link>https://nerdpress.org/2012/04/19/how-to-add-placeholder-attributes-in-silverstripe-userforms-module/#comment-18041</link>

		<dc:creator><![CDATA[Tim]]></dc:creator>
		<pubDate>Fri, 07 Dec 2012 01:23:12 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=2160#comment-18041</guid>

					<description><![CDATA[Thanks for the tips Max!

I tried out your code, and found there was an issue with the labels for checkboxes disappearing. The other issue was that it was only working in modern browsers, so I found a nice function to test the browser&#039;s compatibility, and then I found a plugin that works on all browsers!

My workaround is as follows:
[javascript]
function placeholderIsSupported() {
    test = document.createElement(&#039;input&#039;);
    return (&#039;placeholder&#039; in test);
}

jQuery(document).ready(function(){
    jQuery(&#039;form label&#039;).each(function(){
        if(jQuery(this).parent(&#039;.textarea, .text, .password, .type-text, .type-textarea&#039;).length == 1){
            if(placeholderIsSupported()){
                        jQuery(this).parent().find(&#039;.text, textarea&#039;).attr(&#039;placeholder&#039;, jQuery(this).html());
                        jQuery(this).remove();
            }else{
                convertLabel(jQuery(this));
            }
        }
    });
[/javascript]
Notes:
I&#039;m using this with SilverCart which has some non-standard classes (type-text and type-textarea).
The convertLabel function uses this plugin:
http://www.dhmedia.com.au/blog/nice-placeholders-jquery


Hope this helps someone!]]></description>
			<content:encoded><![CDATA[<p>Thanks for the tips Max!</p>
<p>I tried out your code, and found there was an issue with the labels for checkboxes disappearing. The other issue was that it was only working in modern browsers, so I found a nice function to test the browser&#8217;s compatibility, and then I found a plugin that works on all browsers!</p>
<p>My workaround is as follows:</p>
<pre class="brush: jscript; title: ; notranslate">
function placeholderIsSupported() {
    test = document.createElement('input');
    return ('placeholder' in test);
}

jQuery(document).ready(function(){
    jQuery('form label').each(function(){
        if(jQuery(this).parent('.textarea, .text, .password, .type-text, .type-textarea').length == 1){
            if(placeholderIsSupported()){
                        jQuery(this).parent().find('.text, textarea').attr('placeholder', jQuery(this).html());
                        jQuery(this).remove();
            }else{
                convertLabel(jQuery(this));
            }
        }
    });
</pre>
<p>Notes:<br />
I&#8217;m using this with SilverCart which has some non-standard classes (type-text and type-textarea).<br />
The convertLabel function uses this plugin:<br />
<a href="http://www.dhmedia.com.au/blog/nice-placeholders-jquery" rel="nofollow ugc">http://www.dhmedia.com.au/blog/nice-placeholders-jquery</a></p>
<p>Hope this helps someone!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
