No, it's not.  When you invoke the submit method on a form, its onsubmit handler is not executed at all.  That's the reason this code is necessary in the first place.

-Matt

On 9/28/05, Paul Klaer <[EMAIL PROTECTED]> wrote:
Be careful with that script!

Your onsubmit method is executed twice if it will return a value true!

You have to use this code:

if(document.forms['body:theForm'].onsubmit) {
      document.forms['body:theForm'].submit();
} else {
    document.forms['body:theForm'].submit();
}

otherwise:

if(document.forms['body:theForm'].onsubmit) {
    if(document.forms['body:theForm'].onsubmit()) <<<<<<<- onsubmit is
executed here and if it returns true submit
      document.forms['body:theForm'].submit();   <<<<<<<-- and onsubmit is
executed here
} else {
     document.forms['body:theForm'].submit();
}

On Wed, 28 Sep 2005 03:24:06 +0200, Saul Qunming Yuan < [EMAIL PROTECTED]>
wrote:

> if(document.forms['body:theForm'].onsubmit) {
>    if(document.forms['body:theForm'].onsubmit())
>     document.forms['body:theForm'].submit();
>   } else {
>    document.forms['body:theForm'].submit();
>   }



Reply via email to