Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Thanked 0 Times in 0 Posts

    Onsubmit - need to add 2 things...

    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

  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    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...
    Be yourself. No one else is as qualified.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts