Problem with jquery onHandler (1.7 and above).

Gold Contributor
Gold Contributor
I'm trying to get onchange value of select "itempage" Here is the code
3 REPLIES 3

Problem with jquery onHandler (1.7 and above).

Employee Emeritus
Hi Nitin; I think you have a few things going on that could be causing this not to work. 1. Have you tried setting the selector for Jquery Handler just to #itemPage ?.. this is the DOM object you want to attach to I believe, and the simplest selector to latch onto with the HTML you have present. 2. The only other catch I see is that you have your own onchange functionality going on for the select object, and if you do use JQuery to attach the utag.link function to the object, it will only run the utag.link functionality and not your custom code you have (I am referring specifically to javaScript:setCurrentId('itemsPage');SearchBasedNavigationDisplayJS.changeItemsPerPage(this.value)) One suggestion I have is to try to remove your custom code for the onchange within the HTML and try using the Jquery onHandler extension to run both your own custom code (there are 3 Tracking Event options in the extension--> link,view and custom, my suggestion is to use custom) which combines the two code blocks. *Keep in mind, I am making the assumption that the two functions setCurrentId() and SearchBasaedNavigationDisplayJS() are local JavaScript functions that are available on the page* If that's the case, the the code block in the extension would be something like setCurrentId('itemsPage'); SearchBasedNavigationDisplayJS.changeItemsPerPage(this.value); utag.link({element_id:' AG:US:Items Per Page Dropdown ',element_category:'Product Index',event_type:'element'}); Hope this helps guide you in the right direction, Cheers! -bahman

Problem with jquery onHandler (1.7 and above).

Gold Contributor
Gold Contributor
Thanks Bahman for looking into it. I tried with jQuery Selector as "#itemPage" (earlier too I used it without luck) and followed with custom code that you provided above for Tracking Event Options, however it is still not working. Here is the custom code I used: setCurrentId('itemPage'); SearchBasedNavigationDisplayJS.changeItemsPerPage(this.value); utag.link({element_id:' AG:US:Items Per Page Dropdown ',element_category:'Product Index',event_type:'element'});

Problem with jquery onHandler (1.7 and above).

Employee Emeritus
Hi Nitin; In that case then, I would suggest contacting your account manager to have a solutions engineer take a more specific look at your architecture to get the two code blocks working together. Thanks! -bahman
Public