[Javascript] Q on grabbing ONSUBMIT..

Walter Torres walter at torres.ws
Fri Oct 31 04:28:15 CST 2003


I have this bit...


<form action=""
      id="demo"
      name="demo"
      method="post"
      onsubmit="return doForm ( this, document )">

It works just fine.

This method checks some things and then returns a TRUE or FALSE, and the
FORM is sent based upon that returned value.

Fine, but...

I thought I knew how, but I'm at a loss this early in the morning.

How can I "grab" the 'onSubmit' event, do my checks and then have my method
decide to send the form or not.

In other words, I don't want to have the 'onSubmit' attribute on the FORM
Object Tag.

I just want to INCLUDE a JS file, and the FORM on that page will be handled.

Oh, also, it needs to handle multiple FORMS on a single page.

Any ideas form those who are brighter than I?

Thanks

Walter





More information about the Javascript mailing list