View Full Version : Onsubmit - need to add 2 things...

12-10-2010, 09:08 PM
Hi all,

I was wondering if i could have some help - i am not very technical!

I would like to add 2 things to an onSubmit that is on a form. However, I have been reading various things as to whether or not this is possible.

The button on the form looks like it runs some sort of validation as it starts with onsubmit="validateFormData......

I am trying to set up a goal in analytics and need to add a pageview tracker to the onSubmit as well. Is this possible?

Please help me :)

Old Pedant
12-10-2010, 09:22 PM
Yes, yes, and yes.

<form onsubmit="alert('one thing'); alert('another'); alert('yet another');">
<input type="submit" />

Go ahead. Try that.

Is that the best way to do it? Almost surely not. But without more to go on than what you posted...