<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KirkHings.com &#187; front-line defense</title>
	<atom:link href="http://kirkhings.com/tag/front-line-defense/feed/" rel="self" type="application/rss+xml" />
	<link>http://kirkhings.com</link>
	<description>The '-berger' part trips up so many folks that I sometimes simplify my name for you. Yes, just for you.</description>
	<lastBuildDate>Sat, 13 Jun 2009 18:35:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Disable Submit Button to Prevent Double-Submit</title>
		<link>http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/</link>
		<comments>http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 18:47:45 +0000</pubDate>
		<dc:creator>Kirk</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[front-line defense]]></category>
		<category><![CDATA[self-instructional challenge]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://kirkhings.com/?p=170</guid>
		<description><![CDATA[ photo credit: kevindooley
This programming snippet is from the book, &#8220;jQuery in Action&#8221; which I read and practiced Spring 2009. The Chapter (3) was titled &#8220;Bringing pages to life with jQuery&#8221;.
I post these old code snippets for a few reasons. One is to demonstrate my programming learning, experience, and progression. Another reason is to make [...]


Related posts:<ul><li><a href='http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/' rel='bookmark' title='Permanent Link: jQuery fadeOut upon click'>jQuery fadeOut upon click</a> <small> photo credit: Joel Bedford This programming snippet is from...</small></li>
<li><a href='http://kirkhings.com/code/visual-basic-code/button-driven-quotes/352/' rel='bookmark' title='Permanent Link: Button-Driven Quotes'>Button-Driven Quotes</a> <small> photo credit: bogenfreund This programming challenge is from a...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="borrowedPic"><a href="http://www.flickr.com/photos/12836528@N00/2172001078/" title="Meow Wars" target="_blank"><img src="http://farm3.static.flickr.com/2041/2172001078_d66b957d45.jpg" alt="Meow Wars" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License" target="_blank"><img src="http://kirkhings.com/wp-content/plugins/photo-dropper/images/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/12836528@N00/2172001078/" title="kevindooley" target="_blank">kevindooley</a></small></div>
<p>This programming snippet is from the book, &#8220;jQuery in Action&#8221; which I read and practiced Spring 2009. The Chapter (3) was titled &#8220;Bringing pages to life with jQuery&#8221;.</p>
<p>I post these old code snippets for a few reasons. One is to demonstrate my programming learning, experience, and progression. Another reason is to make sure my code and solutions are indexed by search engines, so that other beginning programmers may get help if they need it. Finally, it is just nice for me to have my own code snippet library, to easily find snippets that I remember doing a particular job but I cannot always recall where I found it.</p>
<blockquote><p>Problem: people sometimes double-click (or more) submit buttons on html forms. Either they do it accidentally because their finger slipped or they did not think they clicked it the first time, or they just like the clicking sound. This can cause a problem with the form being submitted multiple times to the server.
</p></blockquote>
<p>Solution: This jQuery script disables the submit button after the first click. Of course you still need server side code to prevent multiple submissions in case JavaScript is disabled, but this is a good little script for the front line defense. </p>
<pre class="brush: jscript;">
$(&quot;form&quot;).submit(function() {
$(&quot;:submit&quot;,this).attr(&quot;disabled&quot;, &quot;disabled&quot;);
});
</pre>


<p>Related posts:<ul><li><a href='http://kirkhings.com/code/jquery/jquery-fadeout-upon-click/307/' rel='bookmark' title='Permanent Link: jQuery fadeOut upon click'>jQuery fadeOut upon click</a> <small> photo credit: Joel Bedford This programming snippet is from...</small></li>
<li><a href='http://kirkhings.com/code/visual-basic-code/button-driven-quotes/352/' rel='bookmark' title='Permanent Link: Button-Driven Quotes'>Button-Driven Quotes</a> <small> photo credit: bogenfreund This programming challenge is from a...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://kirkhings.com/code/jquery/disable-submit-button-to-prevent-double-submit/170/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
