this only take into consideration that they are clicking the submit button.
what if they are just pressing the enter key in a text field?

you could go on and disable everything in the form, but you would have to do
it after the form submits cause disabled form fields dont get submitted with
the form

maybe something like this?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
        <title>Untitled</title>
        <script>
                function hideForm() {
                        var formObj = arguments[0];
                        var formHeight = formObj.offsetHeight;
                        var formWidth = formObj.offsetWidth;
                        var newDiv = document.createElement("DIV");
                        newDiv.innerHTML = "form is submitting";
                        newDiv.style.height = formHeight;
                        newDiv.style.width = formWidth;
                        newDiv.style.position = "absolute";
                        newDiv.style.top = formHeight / 2;
                        formObj.style.visibility = "hidden";
                        formObj.parentNode.appendChild(newDiv);
                        return false;
                        }
        </script>
        <style>
                form {
                        margin :0px;
                        }
        </style>
</head>

<body>
<table width="100%">
        <tr>
                <td>
                        <form action="" method="post" onsubmit="return 
hideForm(this);">
                        <table>
                                <tr><td>name</td><td><input></td></tr>
                                <tr><td>name</td><td><input></td></tr>
                                <tr><td>name</td><td><input></td></tr>
                                <tr><td>name</td><td><input></td></tr>
                                <tr><td>&nbsp;</td><td><input 
type="Submit"></td></tr>
                        </table>
                        </form>
                </td>
        </tr>
</table>
</body>
</html>

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of KNOTT,
Brian
Sent: Monday, September 05, 2005 3:06 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: OT: Mulitple Submits


Might also be an idea to add a javascript line to make the button inactive
once you have set the value to please wait.

Brian

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, 5 September 2005 2:57 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: OT: Mulitple Submits

something like this Scott?

<script language="javascript">
function processForm(){
if (document.forms[0].formSubmit.value=="Submit"){
 document.forms[0].formSubmit.value="Please wait";
 document.forms[0].submit();
}
}
</script>

<input type="button" name="formSubmit" value="Submit"
onclick="processForm();">

*not tested* ... actually written while in a web based mail client

> Hi,
>
> I am looking for some code to take a humble submit button, and make it
> multiple-submit proof. I have seen it around before, but can't recall the
> solution.
>
> Eg, After clicking, the button text changes to "Please wait", and becomes
> disabled, and the form submits still.....
>
> Cheers,
>
> Scott Thornton, Programmer
> Application Development
> Information Services and Telecommunications
> Hunter-New England Area Health Service
> Phone  RNH +61 2 49236066
> Fax       +61 2 49236076
>
> [EMAIL PROTECTED]
>
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
>



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

----------------------------------------------------------------------------
-------
This e-mail is sent by Suncorp-Metway Limited ABN 66 010 831 722 or one of
its related entities "Suncorp".

Suncorp may be contacted at Level 18, 36 Wickham Terrace, Brisbane or on 13
11 55  or at suncorp.com.au.

The content of this e-mail is the view of the sender or stated author and
does not necessarily reflect the view of Suncorp. The content, including
attachments, is a confidential communication between Suncorp and the
intended recipient. If you are not the intended recipient, any use,
interference with, disclosure or copying of this e-mail, including
attachments, is unauthorised and expressly prohibited. If you have received
this e-mail in error please contact the sender immediately and delete the
e-mail and any attachments from your system.

If this e-mail constitutes a commercial message of a type that you no longer
wish to receive please reply to this e-mail by typing Unsubscribe in the
subject line.



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/



---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to