IncaWarrior
Programmer
I am trying to make a form that will disable after it has been clicked (So people don't submit more than once). I found this code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements;
if (tempobj.type.toLowerCase() == "submit"
tempobj.disabled = true;
}
}
}
// End -->
(I think that's all i need from it)
in the head and:
<form method=post action="[form_action]" onSubmit="return disableForm(this);">
and the form (<input type=submit name=submit value="Submit"> ).
the button becomes disabled after clicking on it, but it is not submitted, anyone know how to do this?
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements;
if (tempobj.type.toLowerCase() == "submit"

tempobj.disabled = true;
}
}
}
// End -->
(I think that's all i need from it)
in the head and:
<form method=post action="[form_action]" onSubmit="return disableForm(this);">
and the form (<input type=submit name=submit value="Submit"> ).
the button becomes disabled after clicking on it, but it is not submitted, anyone know how to do this?