Log in

View Full Version : Disabling Submit Button After Submission


FatalBreeze
03-19-2008, 09:57 AM
Hello, I'm using this script to disable submit button after submission:


function disableForm(theform) {
if (document.all || document.getElementById)
{
for (i = 0; i < theform.length; i++)
{
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
setTimeout('alert("Your form has been submitted. Notice how the submit and reset buttons were disabled upon submission.")', 20);
return false;
}
}


and everything works fine, but when i wrap the input elements with <fieldset> it just doesn't work.

Does anyone have a solution?

Thanks in advance.

FatalBreeze
03-20-2008, 10:27 AM
does anyone ha an idea please??