1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

GA Code Question: Using "onclick" for two things in one line of submit button code?

Discussion in 'Google Analytics' started by mktngguy, Feb 10, 2012.

  1. #1
    Hello,

    I'm trying to use "onclick" for two different things in the same line of submit button code. The form error handling function was already in the code, and I need to retain this feature. But I need to add GA event tracking to the submit button code.



    The following code does not work. Please let me know what I may be doing wrong:



    <input type="submit" name="submit" value="Submit" class="submitbutton" onClick="return CheckBusiness(); _gaq.push(['_trackEvent', 'Take_Action_Form', 'Form_Submission', 'R_Sidebar', 1.00, false]);" style="cursor: pointer;" />



    Also, I ran the code this .js code through a validator and it mention that "onclick" should be all lower case, not "onClick". Does this matter?


    Looking forward to your expert advice. Thanks in advance!

    MktngGuy



     
    mktngguy, Feb 10, 2012 IP