<?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>Tue, 15 May 2012 21:39:02 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Arvid</title><link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/#comment-1843</link> <dc:creator>Arvid</dc:creator> <pubDate>Thu, 10 May 2012 09:51:20 +0000</pubDate> <guid
isPermaLink="false">http://greatwebguy.com/?p=70#comment-1843</guid> <description>Out from Luke Burns post...
var i = 0;
$(document).ready(function(){
$(&quot;#formID&quot;).submit(function(){
i++;
if ( i &gt; 1 ) { return false; }
});
});
Tested in IE9, firefox, Chrome and works with Ajax/jquery inline form validation..
So really happy about finding this article :)</description> <content:encoded><![CDATA[<p>Out from Luke Burns post&#8230;</p><p>var i = 0;<br
/> $(document).ready(function(){<br
/> $(&#8220;#formID&#8221;).submit(function(){<br
/> i++;<br
/> if ( i &gt; 1 ) { return false; }<br
/> });<br
/> });</p><p>Tested in IE9, firefox, Chrome and works with Ajax/jquery inline form validation..</p><p>So really happy about finding this article <img
src='http://greatwebguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Vipin J S</title><link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/#comment-1748</link> <dc:creator>Vipin J S</dc:creator> <pubDate>Sat, 19 Nov 2011 11:22:16 +0000</pubDate> <guid
isPermaLink="false">http://greatwebguy.com/?p=70#comment-1748</guid> <description>Thanks Rinze.. :)
$(document).ready(function(){
$(‘form’).submit(function(){
if (this.beenSubmitted)
return false;
else
this.beenSubmitted = true;
});
});</description> <content:encoded><![CDATA[<p>Thanks Rinze.. <img
src='http://greatwebguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>$(document).ready(function(){<br
/> $(‘form’).submit(function(){<br
/> if (this.beenSubmitted)<br
/> return false;<br
/> else<br
/> this.beenSubmitted = true;<br
/> });<br
/> });</p> ]]></content:encoded> </item> <item><title>By: Ed Elfreth</title><link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/#comment-1687</link> <dc:creator>Ed Elfreth</dc:creator> <pubDate>Thu, 08 Sep 2011 11:55:20 +0000</pubDate> <guid
isPermaLink="false">http://greatwebguy.com/?p=70#comment-1687</guid> <description>for some reason my example didn&#039;t fully post.  here is the class getting applied to a link button </description> <content:encoded><![CDATA[<p>for some reason my example didn&#8217;t fully post.  here is the class getting applied to a link button</p> ]]></content:encoded> </item> <item><title>By: Ed Elfreth</title><link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/#comment-1686</link> <dc:creator>Ed Elfreth</dc:creator> <pubDate>Thu, 08 Sep 2011 11:52:17 +0000</pubDate> <guid
isPermaLink="false">http://greatwebguy.com/?p=70#comment-1686</guid> <description>I just wanted to post this for ASP.NET link buttons.  I couldn&#039;t get the above solutions to work with link buttons, but this works pretty well as an alternative.  It disables all buttons with transactionLinkButtonJQ class applied.
I have this in my master page:
String.prototype.replaceAll = function (stringToFind, stringToReplace) {
var temp = this;
var index = temp.indexOf(stringToFind);
while (index != -1) {
temp = temp.replace(stringToFind, stringToReplace);
index = temp.indexOf(stringToFind);
}
return temp.toString();
};
$(&quot;.transactionLinkButtonJQ&quot;).bind(&quot;click&quot;, function() {
//alert(this.id);
$(&quot;.transactionLinkButtonJQ&quot;).each(function () {
$(this).attr(&quot;disabled&quot;, &quot;disabled;&quot;);
});
__doPostBack(this.id.replaceAll(&#039;_&#039;, &#039;$&#039;), &#039;&#039;)
});
}
any link button you want disabled on a page after a click you have to add the class transactionLinkButtonJQ (see below) </description> <content:encoded><![CDATA[<p>I just wanted to post this for ASP.NET link buttons.  I couldn&#8217;t get the above solutions to work with link buttons, but this works pretty well as an alternative.  It disables all buttons with transactionLinkButtonJQ class applied.</p><p>I have this in my master page:</p><p> String.prototype.replaceAll = function (stringToFind, stringToReplace) {<br
/> var temp = this;<br
/> var index = temp.indexOf(stringToFind);</p><p> while (index != -1) {<br
/> temp = temp.replace(stringToFind, stringToReplace);<br
/> index = temp.indexOf(stringToFind);<br
/> }</p><p> return temp.toString();<br
/> };</p><p> $(&#8220;.transactionLinkButtonJQ&#8221;).bind(&#8220;click&#8221;, function() {<br
/> //alert(this.id);<br
/> $(&#8220;.transactionLinkButtonJQ&#8221;).each(function () {<br
/> $(this).attr(&#8220;disabled&#8221;, &#8220;disabled;&#8221;);<br
/> });<br
/> __doPostBack(this.id.replaceAll(&#8216;_&#8217;, &#8216;$&#8217;), &#8221;)<br
/> });<br
/> }</p><p>any link button you want disabled on a page after a click you have to add the class transactionLinkButtonJQ (see below)</p> ]]></content:encoded> </item> <item><title>By: Rinze Krol</title><link>http://greatwebguy.com/programming/dom/prevent-double-submit-with-jquery/#comment-1662</link> <dc:creator>Rinze Krol</dc:creator> <pubDate>Fri, 26 Aug 2011 12:28:16 +0000</pubDate> <guid
isPermaLink="false">http://greatwebguy.com/?p=70#comment-1662</guid> <description>@ Henrik Nyh
I prefer your solution as well. I generalized it to any form:
$(document).ready(function(){
$(&#039;form&#039;).submit(function(){
if (this.beenSubmitted)
return false;
else
this.beenSubmitted = true;
});
});</description> <content:encoded><![CDATA[<p>@ Henrik Nyh<br
/> I prefer your solution as well. I generalized it to any form:<br
/> $(document).ready(function(){<br
/> $(&#8216;form&#8217;).submit(function(){<br
/> if (this.beenSubmitted)<br
/> return false;<br
/> else<br
/> this.beenSubmitted = true;<br
/> });<br
/> });</p> ]]></content:encoded> </item> </channel> </rss>
