<?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: Enabling submit button if text entered</title>
	<atom:link href="http://cakebaker.42dh.com/2009/01/13/enabling-submit-button-if-text-entered/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2009/01/13/enabling-submit-button-if-text-entered/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2009/01/13/enabling-submit-button-if-text-entered/comment-page-1/#comment-117463</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 15 Jan 2009 16:16:27 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1061#comment-117463</guid>
		<description>@all: Thanks for your comments!

@Eelco: Yes, if you don&#039;t want to disable the button in the html you have to use the snippet you provided.

@Xr: Hm, I think this is handled automatically by jQuery. At least if I look at the DOM with FireBug, the &quot;disabled&quot; attribute disappears when the button is enabled by the script (and reappears when the script disables the button).</description>
		<content:encoded><![CDATA[<p>@all: Thanks for your comments!</p>
<p>@Eelco: Yes, if you don&#8217;t want to disable the button in the html you have to use the snippet you provided.</p>
<p>@Xr: Hm, I think this is handled automatically by jQuery. At least if I look at the DOM with FireBug, the &#8220;disabled&#8221; attribute disappears when the button is enabled by the script (and reappears when the script disables the button).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xr</title>
		<link>http://cakebaker.42dh.com/2009/01/13/enabling-submit-button-if-text-entered/comment-page-1/#comment-117315</link>
		<dc:creator>Xr</dc:creator>
		<pubDate>Wed, 14 Jan 2009 07:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1061#comment-117315</guid>
		<description>Fenrir: for mouse pasting, you could use the onchange event, but it won&#039;t be triggered before a focus change (the submit will not magically be enabled when something is entered).

As for the browser auto-fill, you could probably replace Eelco&#039;s code with
&lt;code&gt;
$(function() {
    $(&#039;#submit&#039;).attr(&#039;disabled&#039;, !$(&#039;#username&#039;).val()); 
})
&lt;/code&gt;
Hoping the browser fills fields before triggering the onload event.

On a sidenote, this does not generate valid XHTML and I&#039;m surprised this works since even the HTML 4.01 specifies that the element will be disabled if the attribute is set (not only if set to a non-null string). In regards to that, the first code was better but I didn&#039;t test any of them.</description>
		<content:encoded><![CDATA[<p>Fenrir: for mouse pasting, you could use the onchange event, but it won&#8217;t be triggered before a focus change (the submit will not magically be enabled when something is entered).</p>
<p>As for the browser auto-fill, you could probably replace Eelco&#8217;s code with<br />
<pre><code>$(function() {
    $('#submit').attr('disabled', !$('#username').val()); 
})</code></pre><br />
Hoping the browser fills fields before triggering the onload event.</p>
<p>On a sidenote, this does not generate valid XHTML and I&#8217;m surprised this works since even the HTML 4.01 specifies that the element will be disabled if the attribute is set (not only if set to a non-null string). In regards to that, the first code was better but I didn&#8217;t test any of them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fenrir</title>
		<link>http://cakebaker.42dh.com/2009/01/13/enabling-submit-button-if-text-entered/comment-page-1/#comment-117291</link>
		<dc:creator>Fenrir</dc:creator>
		<pubDate>Wed, 14 Jan 2009 03:52:42 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1061#comment-117291</guid>
		<description>What if username was filled by browser itself or pasted by mouse only?</description>
		<content:encoded><![CDATA[<p>What if username was filled by browser itself or pasted by mouse only?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eelco Wiersma</title>
		<link>http://cakebaker.42dh.com/2009/01/13/enabling-submit-button-if-text-entered/comment-page-1/#comment-117269</link>
		<dc:creator>Eelco Wiersma</dc:creator>
		<pubDate>Tue, 13 Jan 2009 22:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1061#comment-117269</guid>
		<description>Don&#039;t forget to add the following, in order to disable the submit button once the document is loaded:

&lt;code&gt;
$(function() {
    $(&#039;#submit&#039;).attr(&#039;disabled&#039;, &#039;disabled&#039;);
})
&lt;/code&gt;

Instead of hardcoding the disable tag in your html.</description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget to add the following, in order to disable the submit button once the document is loaded:</p>
<pre><code>$(function() {
    $('#submit').attr('disabled', 'disabled');
})</code></pre>
<p>Instead of hardcoding the disable tag in your html.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

