Expand my Community achievements bar.

SOLVED

Custom data attribute on an <option> tag doesn't fire EBR only on Chrome

Avatar

Level 3

I have an application where I want to track the selection of an item in a dropdown.  I've asked the dev team to add a custom data attribute to each of the <option> tags.  Here is an example of one:

<option digitaldata-feature="filter" value="Other"> Other</option>

I have an EBR set up to look for the click of the digitaldata-feature attribute.  The rule fires perfectly in IE and Firefox but it does not fire at all in Chrome.  I've tried the EBR with the "Apply event handler directly to the element" both on and off but the rule will not fire in Chrome either way.  

Any ideas what to do about Chrome?

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi Pankaj!

The selector that I was using was just "[digitaldata-feature]".  Adding the option didn't work, but it did give me some ideas to try.  I had the attribute added to several different types of fields, so I broke up my one rule into separate rules using the different elements (a and input), but used the id of the select to look for changes to the dropdown.  Setting up the rule on the change of the select instead of the click of the option works for all browsers I tried.

Thanks for the ideas!

Christy

View solution in original post

3 Replies

Avatar

Level 1

Hi Christy 

Can you let us know the selector you used, meanwhile can try this and see if it works. I could see it working in Chrome as well.

option[digitaldata-feature]

I have all the check boxes selected under bubbling, if it helps

 

Regards,

Pankaj

Avatar

Correct answer by
Level 3

Hi Pankaj!

The selector that I was using was just "[digitaldata-feature]".  Adding the option didn't work, but it did give me some ideas to try.  I had the attribute added to several different types of fields, so I broke up my one rule into separate rules using the different elements (a and input), but used the id of the select to look for changes to the dropdown.  Setting up the rule on the change of the select instead of the click of the option works for all browsers I tried.

Thanks for the ideas!

Christy

Avatar

Level 10

Christy,

Sounds like you were able to solve your own question. Feel free to mark your answer as correct if it solved your issue. Thanks for stopping by the community.smiley

Thanks,
Jantzen