Event Based Rule to Fire on Multiple Element Tag or Selectors

Thomas_S_DLX

13-11-2017

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>

Accepted Solutions (1)

Accepted Solutions (1)

joshd7227840

MVP

15-11-2017

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"]

Answers (1)

Answers (1)

PratheepArunRaj

Moderator

13-11-2017

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