[thelist] 2 events one onClick?

Cory Foy Cory.Foy at mindspring.com
Thu Jun 28 05:42:38 CDT 2001

> Hi Gang,
> is it possible to have to things happen on the one onCLick?  I
> have one that
> checks a form for correctness.  If its correct it just submits the details
> in the form and leaves them there.  What I want to do is submit
> the details
> and redirect to thank you page all on the one onClick.  My current JS
> function ends with a return true which I think triggers the form
> to be sent
> so I cant interfere with that or the form wont be sent (?).

Where is it leaving them at? They should be being taken to your action page.
 From there, you can direct them wherever you would like for them to go.
Generally, using either ASP or Cold Fusion, I redirect them after processing
the form using a server-side directive to relocate them. However, you could
just but a javascript directive in the action page to send it.

But, to answer you question generally, yes, you can do multiple actions in
one onClick. You simply seperate the actions with a semicolon.

<input type="submit" onClick="yourFunction();myFunction();alert('I am
submitting your form')">

Hope this helps!

Cory Foy
Hillsborough County Information Technology
Phone: (813) 276-8287
Email: foyc at hillsboroughcounty.org
Web: www.hillsboroughcounty.org

More information about the thelist mailing list