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

Event Based Rule to Fire on Multiple Element Tag or Selectors

Thomas_S_DLX
Level 2
Level 2

I am trying to have a single event base rule fire on two different button clicks. I can only get one to work at a time so I had to create two different rules.

I tried using the classes, data-ceid, etc. If I do one at a time they both work, hence I implemented two event rules, but how could I have done this with one rule?

<button style="padding-top: 7px; padding-bottom: 7px; padding-right: 35px; margin-bottom: 7px;" class="red-button-lg eh-cta" title="Top Submit" data-ceid="Top Submit Button"><img style="padding-left: 0;" src="/sites/www.xyz.com/files/arrow.png" alt=""><span style="display:inline-block; padding-top:10px; padding-left: 20px;">Sign up today</span></button>

<button class="buttonicon talk eh-cta" title="Bottom Let's Talk" data-ceid="Bottom Let's Talk" type="button">

          <img alt="" src="/sites/www.xyz.com/files/arrow.png" style="padding-left: 0; width: 42px; height: 42px;">

          <span style="display:inline-block; padding-top:7px">Sign up today</span></button>

1 Accepted Solution
joshd7227840
Correct answer by
Community Advisor
Community Advisor

In the Element Tag or Selector field, you can separate multiple selectors with a comma. For example, based on what you highlighted red in your post, you can use this:

button.red-button-lg.eh-cta[data-ceid="Top Submit Button"],button.buttonicon.talk.eh-cta[data-ceid="Bottom Let\'s Talk"]

View solution in original post

0 Replies
PratheepArunRaj
Moderator
Moderator

Hello Thomas,

1. Under Event Based Rules, try to assign Propetries and Values in manual : Below the screen grab.

Answer1.png

2. If the above solution didnt work, Create a Page Load Rule. Under Javascript/Third Party Tags, customize you JavaScript coding to fire the specific events for both the buttons on on-click action. This should definitly work!

Thank You!

Arun

joshd7227840
Correct answer by
Community Advisor
Community Advisor

In the Element Tag or Selector field, you can separate multiple selectors with a comma. For example, based on what you highlighted red in your post, you can use this:

button.red-button-lg.eh-cta[data-ceid="Top Submit Button"],button.buttonicon.talk.eh-cta[data-ceid="Bottom Let\'s Talk"]

View solution in original post