I'm trying to track a onChange
action on a select list.
I need to return a selectedIndex, seams not working.
Here is my code:
<select name="triOrdre" id="triOrdre"
onchange="_gaq.push(['_trackEvent','Outils','Trier',this.selectedIndex]);">
<option value="myURL0">Option0</option>
<option value="myURL1">Option1</option>
<option value="myURL2">Option2</option>
<option value="myURL3">Option3</option>
<option value="myURL4">Option4</option>
</select>
The information I need is 0, 1, 2, 3 or 4, regarding to the selectedIndex.
If I put this.value
, I get the selectedValue (so myURL0, 2, ...).
But nothing is working with selectedIndex.
BUT:
If I try on Chrome with the GA debug pluggin, the pluggin see the trackevent with the expected values.
Ex: ['_trackEvent','Outils','Trier',1]
but nothing appear in firebug or HTTPFox pluggin.
Thanks reading, and thanks for you future help.
Jim.
Outils'
. You ought to be seeing console errors about that...