Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Assign input variable to onclick event


AnonyMouse - 10:20 am on Jun 28, 2008 (gmt 0)


Hi,

I have a search box that has a single input field and a submit button. When the submit button is pressed, an onClick event calls Google's urchinTracker.

I'd like to append whatever variable is put in the search box, to the onClick event so I can see it in Google Analytics:

<input name="searchterm" type="text">
<input type="submit" name="Submit" value="Submit" onClick=\"javascript:urchinTracker ('/siteSearch_SEARCHTERM_GOES_HERE'); >

Is this possible using JavaScript? Thanks in advance for any replies.


Thread source:: http://www.webmasterworld.com/javascript/3685880.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com