On 7/11/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> If you are not script-averse, the solution to this that I've always used
>   is to disable the button client-side before submitting the form.
> 
> It's not a perfect solution though, as there is no way to re-submit if a
> problem occurs (i.e., if it hangs for a long time... outright
> server-side errors would still occur as usual of course), but in many
> situations it's fine.  Note that PayPal is one example of a major site
> that does this.
> 
> Frank

I agree, something like this works pretty well, but you still need to
check for resubmits, if resubmitting must not be allowed at all.

<script language="JavaScript">
  function SubmitForm(){
    document.getElementById('sub').disabled = true;
    document.forms['msgform'].submit();
    return true;
  }
</script>

<form action="..." method="post" name="msgform" id="msgform">
  ...
  <input id="sub" type="submit" onclick="SubmitForm();" 
         name="param_submit" value="Submit This Form"  />
</form>

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to