CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Disable ALL buttons on a form on submit

Print topic Send  topic

Author Message
Headhunter
Posted: 11/06/2003, 1:37 PM

CCS2, PHP4, MYSQL,

I have a javascript which disables the submit button of a form on submit.
So far, no problem.
Now, I want when submitting, canceling or updating a form that all the buttons are disabled during form operations.

Thanx
Hamilton
Posted: 11/06/2003, 7:19 PM

Using the following function, add the names of the additional buttons you want to disable.

Hope this helps.


<!--
<script>
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
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
</script>
//-->


<form onSubmit="submitonce(this)">


Hamilton
www.dataobjx.net
Headhunter
Posted: 11/07/2003, 12:18 PM

Thanks, but already tried this script. It doesn't work for update and delete buttons. When I use it, you can hit any button and no form actions will fire.

Other sollution?

I also tried this one, but I can't get it to work on more than one button.

<--
<script type="text/javascript">
var subd = false;
function disable() {
if (subd == true) {
document.getElementById("sub").disabled = true;
}
}
function do_disable() {
subd = true;
disable();
}
function alertSubState() {
alert(subd);
}
</script>
//-->

<div>
<form onsubmit="do_disable();">
<input id="sub" type="submit" />
<input type="button" value="Check"/>
</form>
</div>
Hamilton
Posted: 11/08/2003, 4:11 AM

Tricky,

The first URL will take you to a site that contains tons of JavaScripts.

Regarding disabing the buttons... IE may require that you make the 'event' - "bubble down"... e.g., pass the event further on after it executes the first time.

It may be that the events are not 'bubbling down'.... see the second url provided.

http://developer.irt.org/script/script.htm
http://developer.irt.org/script/507.htm

Is the page remaining on the screen for so long that the user can continue to click buttons?

I'm not visualizing the situation very well. Can you provide a brief rundown?

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.