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