<?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: Prevent double submit with jQuery</title>
	<atom:link href="http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/</link>
	<description>Self-proclaimed greatness is a hard thing to prove.</description>
	<lastBuildDate>Mon, 01 Mar 2010 19:05:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Garland Pope</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-1208</link>
		<dc:creator>Garland Pope</dc:creator>
		<pubDate>Sat, 30 Jan 2010 21:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-1208</guid>
		<description>Henrik said he preferred another solution without saying why.  I checked it out, and I see its advantages.  While webguy&#039;s solution elegantly prevents a submit _button_ from being double clicked, it does not handle all ways a form can be submitted, most importantly by pressing the enter key.  Henrik&#039;s solution works directly on the form rather than the specific means of submitting it.  That takes care of submit buttons, images, enter keys, scripts, or any other method of submitting the form.  Thanks for the help, both of you.</description>
		<content:encoded><![CDATA[<p>Henrik said he preferred another solution without saying why.  I checked it out, and I see its advantages.  While webguy&#8217;s solution elegantly prevents a submit _button_ from being double clicked, it does not handle all ways a form can be submitted, most importantly by pressing the enter key.  Henrik&#8217;s solution works directly on the form rather than the specific means of submitting it.  That takes care of submit buttons, images, enter keys, scripts, or any other method of submitting the form.  Thanks for the help, both of you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garland Pope</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-1207</link>
		<dc:creator>Garland Pope</dc:creator>
		<pubDate>Sat, 30 Jan 2010 21:38:12 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-1207</guid>
		<description>Randy, your problem is probably that $(this) is a reference to the object calling the function.  In the original, that is the form.  But in your ajax success function, it most likely refers to something else.  So it&#039;s trying to &quot;find&quot; image and submit inputs inside whatever $(this) refers to and not finding them.  If you replace $(this) in your ajax success callback with a selector that points to your form (probably just using its ID), it might fix the problem.</description>
		<content:encoded><![CDATA[<p>Randy, your problem is probably that $(this) is a reference to the object calling the function.  In the original, that is the form.  But in your ajax success function, it most likely refers to something else.  So it&#8217;s trying to &#8220;find&#8221; image and submit inputs inside whatever $(this) refers to and not finding them.  If you replace $(this) in your ajax success callback with a selector that points to your form (probably just using its ID), it might fix the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randy Johnson</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-1194</link>
		<dc:creator>Randy Johnson</dc:creator>
		<pubDate>Sun, 10 Jan 2010 19:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-1194</guid>
		<description>Hello,

This solution:

$(’form’).submit(function(){

$(this).find(”input[type=&#039;image&#039;],input[type=&#039;submit&#039;]“).click(function(){

return false;

});

});

does a good job, but how do you enable the submit button again after a return from an ajax call?   I thought do this in the sucess function would fix it but it doesn&#039;t

$(this).find(&quot;input[type=&#039;image&#039;],input[type=&#039;submit&#039;]&quot;).click(function(){

		return true;

	});</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>This solution:</p>
<p>$(’form’).submit(function(){</p>
<p>$(this).find(”input[type='image'],input[type='submit']“).click(function(){</p>
<p>return false;</p>
<p>});</p>
<p>});</p>
<p>does a good job, but how do you enable the submit button again after a return from an ajax call?   I thought do this in the sucess function would fix it but it doesn&#8217;t</p>
<p>$(this).find(&#8220;input[type='image'],input[type='submit']&#8220;).click(function(){</p>
<p>		return true;</p>
<p>	});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Breno Mansur</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-1110</link>
		<dc:creator>Breno Mansur</dc:creator>
		<pubDate>Wed, 22 Jul 2009 11:12:48 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-1110</guid>
		<description>Very good and simple solution!

Additionally, the developer can use an alert (or something) to inform the user that the request is being processed.</description>
		<content:encoded><![CDATA[<p>Very good and simple solution!</p>
<p>Additionally, the developer can use an alert (or something) to inform the user that the request is being processed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BrianLang.ca &#187; Blog Archive &#187; links for 2009-03-27</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-969</link>
		<dc:creator>BrianLang.ca &#187; Blog Archive &#187; links for 2009-03-27</dc:creator>
		<pubDate>Fri, 27 Mar 2009 07:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-969</guid>
		<description>[...] Prevent double submit with jQuery - GreatWebGuy (tags: jquery forms) [...]</description>
		<content:encoded><![CDATA[<p>[...] Prevent double submit with jQuery &#8211; GreatWebGuy (tags: jquery forms) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henrik N</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-801</link>
		<dc:creator>Henrik N</dc:creator>
		<pubDate>Fri, 28 Nov 2008 08:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-801</guid>
		<description>I prefer this: http://henrik.nyh.se/2008/07/jquery-double-submission</description>
		<content:encoded><![CDATA[<p>I prefer this: <a href="http://henrik.nyh.se/2008/07/jquery-double-submission" rel="nofollow">http://henrik.nyh.se/2008/07/jquery-double-submission</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: webguy</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-718</link>
		<dc:creator>webguy</dc:creator>
		<pubDate>Thu, 09 Oct 2008 12:39:39 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-718</guid>
		<description>If you take the combination of the two approaches an even more elegant solution is possible

$(’form’).submit(function(){

$(this).find(”input[type=&#039;image&#039;],input[type=&#039;submit&#039;]“).click(function(){

     return false;

});

});</description>
		<content:encoded><![CDATA[<p>If you take the combination of the two approaches an even more elegant solution is possible</p>
<p>$(’form’).submit(function(){</p>
<p>$(this).find(”input[type='image'],input[type='submit']“).click(function(){</p>
<p>     return false;</p>
<p>});</p>
<p>});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-09-18 &#171; 思考と習作（ブックマーク）</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-703</link>
		<dc:creator>links for 2008-09-18 &#171; 思考と習作（ブックマーク）</dc:creator>
		<pubDate>Thu, 18 Sep 2008 17:31:07 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-703</guid>
		<description>[...] Prevent double submit with jQuery - GreatWebGuy jqueryでフォームからの二重投稿を防ぐ方法 (tags: jquery form 二重投稿 防ぐ) [...]</description>
		<content:encoded><![CDATA[<p>[...] Prevent double submit with jQuery &#8211; GreatWebGuy jqueryでフォームからの二重投稿を防ぐ方法 (tags: jquery form 二重投稿 防ぐ) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: webguy</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-696</link>
		<dc:creator>webguy</dc:creator>
		<pubDate>Sat, 28 Sep 2002 21:38:53 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-696</guid>
		<description>Tony,

Thanks improvements are always welcome.  I have run into a slight problem with the approach of disabling buttons during the submit, in some cases developers are using the name of the button clicked to control the routing of the next action, when you disable the buttons, the name is not passed.  This is easily remedied by attaching to the click event:

$(&quot;form&quot;).each(function(){
	var $that = $(this);
	$that.submit(function(){
		$that.find(&quot;input[type=&#039;image&#039;],input[type=&#039;submit&#039;]&quot;).click(function(){
			return false;
		});
	});
});</description>
		<content:encoded><![CDATA[<p>Tony,</p>
<p>Thanks improvements are always welcome.  I have run into a slight problem with the approach of disabling buttons during the submit, in some cases developers are using the name of the button clicked to control the routing of the next action, when you disable the buttons, the name is not passed.  This is easily remedied by attaching to the click event:</p>
<p>$(&#8220;form&#8221;).each(function(){<br />
	var $that = $(this);<br />
	$that.submit(function(){<br />
		$that.find(&#8220;input[type='image'],input[type='submit']&#8220;).click(function(){<br />
			return false;<br />
		});<br />
	});<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tony petruzzi</title>
		<link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/comment-page-1/#comment-694</link>
		<dc:creator>tony petruzzi</dc:creator>
		<pubDate>Sat, 28 Sep 2002 20:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://greatwebguy.com/?p=70#comment-694</guid>
		<description>this will not only work for submit buttons but for also image buttons. comments welcomed.

$(&quot;form&quot;).each(function(){
	var $that = $(this);
	$that.submit(function(){
		$that.find(&quot;input[type=&#039;image&#039;],input[type=&#039;submit&#039;]&quot;).attr(&quot;disabled&quot;, &quot;true&quot;);
	});
});</description>
		<content:encoded><![CDATA[<p>this will not only work for submit buttons but for also image buttons. comments welcomed.</p>
<p>$(&#8220;form&#8221;).each(function(){<br />
	var $that = $(this);<br />
	$that.submit(function(){<br />
		$that.find(&#8220;input[type='image'],input[type='submit']&#8220;).attr(&#8220;disabled&#8221;, &#8220;true&#8221;);<br />
	});<br />
});</p>
]]></content:encoded>
	</item>
</channel>
</rss>
