Coldfusion Code to disable a button
<cfparam name="form.h1" default="0"> <cfif isdefined('form.h1') AND form.h1 EQ 1> <cfoutput>The button is disabled when you submitted the form</cfoutput> </cfif> <cfform onsubmit="document.getElementById('s1').disabled = 1;" action="#cgi.SCRIPT_NAME#?#cgi.QUERY_STRING#"> <cfinput type="text" name="t1" id="t1"><br> <cfinput type="text" name="t2" id="t2"> <cfinput type="hidden" name="h1" id="h1" value="1"> <cfinput type="submit" name="s1" id="s1" value="submit"> </cfform>