# Click --\> "When click on 3 buttons" the image / text should display

**URL:** <https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150>\
**Category:** Need help\
**Created:** [May 31, 2019, 11:09am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150 "2019-05-31T11:09:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.marikukala](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@kiran.marikukala](https://forum.bubble.io/u/kiran.marikukala)\
**Post date:** [May 31, 2019, 11:09am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/1 "2019-05-31T11:09:55Z")

</div>

I want to display the IMAGE / Text only when three (3) buttons are clicked. In condition there is no option like “When click”.

Ex: Selected 3 buttons like grapes , apple , oranges then i want to display the text like thankyou etc…,

---

<div class="post-metadata">

**Author:** ![luke2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/luke2/32/256674_2.png) [@luke2](https://forum.bubble.io/u/luke2)\
**Post date:** [May 31, 2019, 11:24am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/2 "2019-05-31T11:24:56Z")

</div>

Welcome.

There are quite a number of ways to go about this and also it depends where these buttons are situated e.g. just on page in a regular group or in a list in a repeating group format.

I’ll use a very simple concept with just the elements on the page. One way would be to set a custom state on the page that can temporally store data on the page. So when someone clicks the button for ‘Apples’ to will temporally save that text value to the page, so we know the user has clicked that button (from a workflow action). Custom states are very useful and do not require touching the database.

_Note: when the page is refreshed, these custom state values will be cleared from the page._

Here is a very basic example:  
 ![buttons-example-click-state](https://us1.discourse-cdn.com/bubble/original/3X/5/2/528a30f1b0d09d843616d869d9d23988e875edc1.gif)

Link to the Editor:

> **[Bubble Editor - luke2](https://bubble.io/page?type=page&name=state-3-buttons&id=luke2&tab=tabs-1)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

---

<div class="post-metadata">

**Author:** ![luke2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/luke2/32/256674_2.png) [@luke2](https://forum.bubble.io/u/luke2)\
**Post date:** [May 31, 2019, 11:32am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/3 "2019-05-31T11:32:28Z")

</div>

So on the page containing these 3 buttons, we will create a state, which is of a text type and is a list:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/6/e68713620afef325da495fbcaee1c78cca27cfdd.png)

For each button we will start a workflow:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/5/d575df3d8efa136abddfdfd64f8df660ce5d0e3e.png)

So for when the button ‘Grapes’ is clicked, it will first look at the custom state on the page and see if there are any existing states set and then plus this item to the list. Otherwise if we just set the state to ‘grapes’ and we have existing custom text states already in the list, these values will be lost. So we need to reference the custom state list and use the modifier :plus item to add to the list, even if the list is currently empty. The defined value can be either static, like this example I’ve just typed ‘grapes’ or you can dynamically pull in a text value from the page or data types e.g. do a search for.

The other 3 buttons use the same principle workflow, the only difference is that the value ‘grapes’ will change to ‘apples’ and so on, depending the button clicked.

Then we simply add a text element below, add required content and make sure this is set to not visible on page load, so we can have a condition to show based on certain interactions with the page:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/1/8/18b745ff1104be9ad2b3940493496ca8e70294d3.png)

Here is the condition we apply, as we know there are 3 buttons and we cannot click the same button twice to make duplicates, as Bubble won’t allow duplicate entries within a custom state list:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/5/6/56502a106dcb516e7e4c8ec1aea755abd51f09d7.png)

Another way would be this, but rather long winded and not necessary as the result is the same:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/2/d/2dbc5fe345df3a889a150791c3c2cc3567c9fc82.png)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![kiran.marikukala](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@kiran.marikukala](https://forum.bubble.io/u/kiran.marikukala)\
**Post date:** [May 31, 2019, 12:15pm UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/4 "2019-05-31T12:15:57Z")

</div>

Hi luke,  
Very clear explanation, Thanks for spending your valuable time.

---

<div class="post-metadata">

**Author:** ![luke2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/luke2/32/256674_2.png) [@luke2](https://forum.bubble.io/u/luke2)\
**Post date:** [May 31, 2019, 1:02pm UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/5 "2019-05-31T13:02:50Z")

</div>

Your welcome. Glad it makes sense.

---

<div class="post-metadata">

**Author:** ![kiran.marikukala](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@kiran.marikukala](https://forum.bubble.io/u/kiran.marikukala)\
**Post date:** [June 1, 2019, 10:42am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/6 "2019-06-01T10:42:54Z")

</div>

I have three buttons for those i need a active state when i clicked on each button, background color should be changed. Can you please help me

---

<div class="post-metadata">

**Author:** ![luke2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/luke2/32/256674_2.png) [@luke2](https://forum.bubble.io/u/luke2)\
**Post date:** [June 1, 2019, 11:02am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/7 "2019-06-01T11:02:51Z")

</div>

Sure, I think I understand right, in that you want an indicator to show the button has indeed been pressed.

Something as simple as this would work:  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/a/b/abea7e1a3bce62d371c10cdff735f27de2e488bf.png)

Again, as mentioned, there are other ways to implement this, depending the end result, to make things easier to maintain, but this example works just fine as a concept.

> **[Bubble - Visual Programming](https://luke2.bubbleapps.io/version-test/state-3-buttons)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [August 9, 2019, 11:10am UTC](https://forum.bubble.io/t/click-when-click-on-3-buttons-the-image-text-should-display/58150/8 "2019-08-09T11:10:00Z")

</div>

Closed on August 9, 2019, 11:10am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
