Stella_uk,
Try this first:
IRT.org Javascript FAQ
Q1636 How can I stop a user from hitting the Submit button twice?
http://developer.irt.org/script/1636.htm
If the above doesn't work in all the cases you need to support, here
is an alternate Javascript method:
From Squeaky's JavaScript crib page
http://www.squeaky.demon.co.uk/jn/usforms.htm
-----------------------------------
: I have a problem with people that hit the submit button more that once on my
: signup form. It creates multiple submissions. Someone told me that there is a
: javascript that prevents someone from hitting a submit button more than once.
: Any help regarding this would be appreciated.
In the head of your html, put this script:
<script>
function checkit ()
{
if (dunnit) {
alert ("One submission per person!");
return false;
} else {
alert ("Thank you for your input.");
dunnit = true;
return true;
}
var dunnit = false;
</script>
_In_ your submit button tag, put this:
onSubmit="return checkit()"
This runs the above function, which checks to see if dunnit is true.
If it is, the form doesn't submit. If it is false, it is set to true
and submits.
----------------------------------
There is also a cookie based method:
NetMechanic
http://www.netmechanic.com/news/vol5/html_no16.htm
Good luck with your web project!
- Hammer |