A question was posed to the Arizona Groups list about how to prevent double-posting to a form on a web page. My favorite solution to do this is set up a variable to track if the submit has happened yet or not. The HTML needs to end up looking like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD><title>FormTest</title></HEAD>
<body>
<script language="javascript">
var haveSubmitted=false;
function FirstSubmitOnly()
{
if(haveSubmitted) return false; haveSubmitted=
true;
return true; //we want the first click to occur.
}
</script>
<form name="Form1" id="Form1" method="post" onsubmit="return FirstSubmitOnly();">
<input type="submit" name="ClickMe" value="Click Me!" id="ClickMe" />
</form>
</body>
</HTML>
In this case the function gets called from the onsubmit event handler on the form element. But you could also put it on the onclick of the <input type="submit"> as well. If you're using ASP.NET then this client-side event handler can be wired up in VB.NET with:
Button1.Attributes.Add("onclick","return FirstSubmitOnly();")
Equivalent C# is of course to just add a semicolon at the end of that line. Hope you find this helpful!