# Displaying Radio button with corresponding Images

**URL:** <https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795>\
**Category:** Need help\
**Created:** [March 3, 2020, 11:49am UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795 "2020-03-03T11:49:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmeenakshi26](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kmeenakshi26/32/54326_2.png) [@kmeenakshi26](https://forum.bubble.io/u/kmeenakshi26)\
**Post date:** [March 3, 2020, 11:49am UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/1 "2020-03-03T11:49:42Z")

</div>

Should be ridiculously simple and heaven knows why I am stuck. So I have a table in database that stores the values of a radio button.

 ![Screenshot 2020-03-03 at 11.58.42](https://us1.discourse-cdn.com/bubble/original/3X/1/9/19b1320d5419eb737c40e4a6995adbc69da9c62d.png) A garden type can only ever have one type and hence in the UI, its represented by radio buttons.  
Now all I want is that when a radio button is displayed - next to it, its image as stored in the DB should also be displayed. the Image and Radio button should go hand in hand - in bubble language - should be part of a group. Like this ![Screenshot 2020-03-03 at 12.02.06](https://us1.discourse-cdn.com/bubble/original/3X/1/9/192ab598c2e7b5d309b41b2510015a85821287da.png) How do you achieve this?!

I cannot use repeating group because if I do so, then each cell will have an image and a radio button ( which expects the full list of options for the radio buttons) whilst what I want is that the user is able to select just one of the choices from the list of Garden types.  
May I ask a favour? if you guys are responding - can you send a snapshot of the actual design rather than explain it in words please. Its lot easier to understand that ways.

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [March 3, 2020, 1:15pm UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/2 "2020-03-03T13:15:11Z")

</div>

> [@kmeenakshi26](#):
>
> I cannot use repeating group

You should be using a repeating group for this. Each cell in the repeating group will have only one garden type for that cell. So each cell will have only one image and only one radio button.

> [@kmeenakshi26](#):
>
> each cell will have an image and a radio button ( which expects the full list of options for the radio buttons)

I really don’t understand what you mean about expects the full list of options for the radio buttons. It sounds like you are confused on what a radio button will be able to refer to. One radio button placed into a repeating group will automatically populate all cells in the repeating group with a radio button. What you need to do is have the data source for the radio button be “current cell’s garden type”; that way the radio button in any given cell will only be associated with the garden type of that particular cell.

> [@kmeenakshi26](#):
>
> what I want is that the user is able to select just one of the choices from the list of Garden types

Using the set up as described above is exactly what will happen. When a user selects the radio button of a cell representing that garden type as the image and text of radio button indicate, only that garden type is being selected.

If you want to make sure the user only is able to select one garden type, that goes into different aspects of workflows etc.

---

<div class="post-metadata">

**Author:** ![kmeenakshi26](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kmeenakshi26/32/54326_2.png) [@kmeenakshi26](https://forum.bubble.io/u/kmeenakshi26)\
**Post date:** [March 3, 2020, 1:33pm UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/3 "2020-03-03T13:33:35Z")

</div>

> [@boston85719](#):
>
> I really don’t understand what you mean about expects the full list of options for the radio buttons. It sounds like you are confused on what a radio button will be able to refer to. One radio button placed into a repeating group will automatically populate all cells in the repeating group with a radio button. What you need to do is have the data source for the radio button be “current cell’s garden type”; that way the radio button in any given cell will only be associated with the garden type of that particular cell.

Thank you Boston, If you try to replicate my problem in bubble editor, you will be able to see from my eyes. what I mean is that in the first cell of the Repeating group - there will be an image of first item of the table Garden type - this will be an allotment and the second element will be a radio button type.

 ![Screenshot 2020-03-03 at 13.44.51](https://us1.discourse-cdn.com/bubble/original/3X/d/7/d767843adeffdbf593f629e0fc016e74c445db03.png) Radio buttons expect a list - always. What list will you feed this Radio button? The entire value of Garden Type ? or the First element of garden Type. Either ways we do this, if we follow the repeating group way, each cell’s repeating group will be checked by default and that’s not what we want. This is what we will end up with ![Screenshot 2020-03-03 at 13.49.01](https://us1.discourse-cdn.com/bubble/original/3X/b/1/b16eea85056cea2d053b47210fae415ec7031e2d.png)  
I would highly recommend it you try it in bubble because I am not able to explain this clearly in words

---

<div class="post-metadata">

**Author:** ![sudsy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sudsy/32/114637_2.png) [@sudsy](https://forum.bubble.io/u/sudsy)\
**Post date:** [March 3, 2020, 8:10pm UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/4 "2020-03-03T20:10:04Z")

</div>

I understand what you’re saying. The **Radio Buttons** element is itself a list, so putting it inside a repeating group (RG) results in a list within a list.

Perhaps the easiest way to go about it would be to forget both the RG and custom type, and simply use an emoji in the name of the radio button options (assuming, of course, that there’s an emoji which accurately represents what you want to depict).

Alternatively, you can create your own radio button-like mutually exclusive selector widget, which is probably not as hard as it might sound and would provide full control over the look of the UI - i.e. you wouldn’t be stuck with the appearance of native radio buttons.

You’re already on the right track to implement something like this, as you’ve created a custom type to be used in a RG. Here’s an example…

- [Custom Radio Buttons Example](https://tt-examples.bubbleapps.io/version-test/custom-radio-buttons)

And [here’s a link](https://bubble.io/page?type=page&name=custom-radio-buttons&id=tt-examples&tab=tabs-1) to the editor.

Basically, there’s a custom state on the RG to keep track of the current selection. A single workflow on the icon sets the current selection. That’s really it.

**EDIT** : Oh, and there’s a conditional on the icon to change its appearance when it’s the currently selected one.

---

<div class="post-metadata">

**Author:** ![kmeenakshi26](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kmeenakshi26/32/54326_2.png) [@kmeenakshi26](https://forum.bubble.io/u/kmeenakshi26)\
**Post date:** [March 4, 2020, 10:31am UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/5 "2020-03-04T10:31:42Z")

</div>

Thanks Shot! I jumped with joy reading the first line of your answer! Somebody understood 😀Thanks again, I dont know why I couldn’t think of this but its perfect solution. Cheers.

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [March 4, 2020, 4:52pm UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/6 "2020-03-04T16:52:47Z")

</div>

Forgot the radio button element requires a list of things as a data source…must have been why I never use it and do as you suggest with the custom buttons.

---

<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:** [May 12, 2020, 11:49am UTC](https://forum.bubble.io/t/displaying-radio-button-with-corresponding-images/80795/7 "2020-05-12T11:49:45Z")

</div>

Closed on May 12, 2020, 11:49am UTC

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