Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    1
    Thanks
    0
    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
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,166
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    Yes, yes, and yes.

    Code:
    <form onsubmit="alert('one thing'); alert('another'); alert('yet another');">
    <input type="submit" />
    </form>
    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...
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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