RE: [PHP] Double Click
| From: | Ovidiu EFTIMIE | Date: | Wed, 28 Feb 2001 08:25:58 +0000 |
| Subject: | RE: [PHP] Double Click | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41962@lists.php.net to get a copy of this message | ||
Use something like this
<script language="JavaScript">
var submitcount=0;
function checkSubmit(s)
if (submitcount == 0)
{
submitcount++;
s.value = " Sending... ";
return true;
}
else
{
alert("This form has already been submitted. Thanks!");
return false;
}
}
</script>
<input type="button" value="Proceed" name="send" onClick="if
(checkSubmit(this.form.send)) this.form.submit();">
And of course you should verify the id field in tha data base as Joe said.
Ovidiu
-----Original Message-----
From: Fabian Fabela [mailto:php@vacagorda.com]
Sent: Wednesday, February 28, 2001 8:16 AM
To: php-general@lists.php.net
Subject: [PHP] Double Click
Hi,
I have a page, and when I have to add a product I use a form, many people
are used to make double click in every task, so when the product is sent
with a double click in the send button, the program send it twice to the
data base.
What can I do to prevent this?
Thank you.
Fabian Fabela
fabian@vacagorda.com
www.vacagorda.com