Jump to content

Disable Button on Submit


Recommended Posts

Before </head> tag:

	<!-- ITEM: Additional Scripts -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
  eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}
//-->
</script>
<!-- ITEM: End -->

 

Inside <form > tag (as an attribute, not a sub-element):

onsubmit="MM_changeProp('UniqueButtonName','','disabled','disabled','INPUT/SUBMIT')"

 

 

(...deleting "oh I accidentally pressed the submit button 9 times while I was waiting" posts hurts my brain.)

Link to comment
Share on other sites

Cap'n Refsmmat said in post # :

So you made it so you can't submit it more than once? Brilliant... except that once the forum crashed, and I had to keep checking. That would ruin it, I'd have to copy/paste it.

If I'm making a large post, I always copy+paste to notepad just in case.

 

Edit:

I just tested it here. It doesn't work.

Tested what?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.