Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

christyw8416449
Level 3
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
christyw8416449
Correct answer by
Level 3
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
pankajkkarole
Level 1
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

christyw8416449
Correct answer by
Level 3
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

jantzen_belliston-Adobe
Level 10
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