<cf_lingo>
11-19-2004, 02:01 PM
I can't get the script below to work. It is supposed to disable the submit button after it is clicked one time. I pulled it from Dynamic Drive and it worked in my browser (IE 6 sp2) on their site example. The only thing I can think of is that I'm using a <CFFORM> tag. Also, there are 2 form/Submit buttons in my code but only one form gets served up via Cold Fusion depending on a choice the user makes on a previous page. FCI offered the following solution http://www.codingforums.com/showthr...=disable+submit but it did not work either. Any ideas on what the problem may be? Thanks.
<script language="javascript" type="text/javascript">
<!--
/*
Submit Once form validation-
*/
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
//-->
</script>
//FORM TAG <cfform name="form" action="cir_Send.cfm" method="post" onSubmit="return submitonce(this)">
<script language="javascript" type="text/javascript">
<!--
/*
Submit Once form validation-
*/
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
//-->
</script>
//FORM TAG <cfform name="form" action="cir_Send.cfm" method="post" onSubmit="return submitonce(this)">