Jump to content

Disable Button on Submit

Featured Replies

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.)

  • Author
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?

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.