withSolutions   Script Sample Showcase
 
Skip Navigation Links.   This ASP.net style JavaScript will stop multiple submits from a web page. You attach the script to the SubmitButton in the Page_Load event using
SubmitButton1.Attributes.Add("onclick", "javascript:if(submitFlag){return false;}else{submitFlag=true;return true;}")

<script type="text/javascript">

                              var submitFlag = false;

</script>

Using this next HTML style JavaScript will allow interaction with .NET's validator to not react if the page was invaliid upon submit. You attach the script to the SubmitButton in the Page_Load event using
SubmitButton.Attributes.Add("onClick", "javascript: return disableSubmit();")

<script language="javascript">

<!--

var submitcount=0;

 

function disableSubmit()

{

                          if (typeof(Page_ClientValidate)=='function')

                          {

                                                        if (Page_ClientValidate() == true)

                                                        {

                                                                                      return checkSubmit();

                                                        }

                                                        else

                                                        {

                                                                                      return true;

                                                        }

                          }

                          else

                          {

                                                        return checkSubmit();

                          }

}

 

function checkSubmit()

{

                          if (submitcount == 0)

                          {

                                                        submitcount++; return true;

                          }

                          else

                          {

                                                        alert('This form has already been submitted.'); return false;

                          }

}

//-->

</script>