# Using checkboxs like option buttons

**URL:** <https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [May 26, 2022, 2:09pm UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163 "2022-05-26T14:09:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![robbie.hegartykulj8](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@robbie.hegartykulj8](https://community.thunkable.com/u/robbie.hegartykulj8)\
**Post date:** [May 26, 2022, 2:09pm UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/1 "2022-05-26T14:09:11Z")

</div>

Hi folks

I’m creating a quiz app; question plus 4 possible answers. Each answer has a checkbox and only one box can be checked (like an option button). I’m trying to identify which of the 4 checkboxes has its value set to true.

I would be grateful for any help.

Robbie

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 26, 2022, 5:27pm UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/2 "2022-05-26T17:27:12Z")

</div>

Welcome to Thunkable.

You will need to have the four check boxes as a group or a list then you create a function to loop through the list testing which one is selected.

You will also need to create another function that will update the status of the four check boxes whenever the user clicks any of them. Your function will turn the status off on all of them except the one clicked.

This can be done easier in StP but it can also be done in DnD.

---

<div class="post-metadata">

**Author:** ![robbie.hegartykulj8](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@robbie.hegartykulj8](https://community.thunkable.com/u/robbie.hegartykulj8)\
**Post date:** [May 27, 2022, 8:19am UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/3 "2022-05-27T08:19:43Z")

</div>

Thanks Muneer

I have the checkboxes in a group and loop through them with a “for each item” block. The loop is inside a “when Any Checkbox Value Changes” block. Inside the loop I’m setting all the checkbox values to false, referencing them using the “j” object. I then set the checkbox that initiated the call to true - referencing it using the “component” object. My problem is identifying which checkbox is true.

I’m teaching a class mobile app development at a fairly low level. We made the decision to use DnD, so I have to stick to that.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 27, 2022, 11:22am UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/4 "2022-05-27T11:22:33Z")

</div>

I hope this demo will help you solve the issue  
[https://x.thunkable.com/projectPage/6290b111693a160012911dd4](https://x.thunkable.com/projectPage/6290b111693a160012911dd4)

---

<div class="post-metadata">

**Author:** ![robbie.hegartykulj8](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@robbie.hegartykulj8](https://community.thunkable.com/u/robbie.hegartykulj8)\
**Post date:** [May 27, 2022, 11:42am UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/5 "2022-05-27T11:42:21Z")

</div>

Whao!

Muneer, that’s above and beyond the call of duty and I really appreciate it.

Many thanks

Robbie

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 28, 2022, 6:42am UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/6 "2022-05-28T06:42:02Z")

</div>

The core of the solution is having standard naming convention for the checkboxes.

This is how the screen will look like  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/f/3f8946f63e5565d8ff2aa357d36629dca1c1fa72.png)

The coding part is divided in two parts

- Part 1 is to take care of the tick whenever the user clicks on one of the checkboxes by removing the tick on the other and making the tick appear on the select one  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/1/312416990d0056f5796fde5477aebc0810d0d325.png)

- Part 2 is to loop through the checkboxes and report which one is ticked.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/6/a669cf6b08f82d350a5a5569b00a37d10c851f62.png)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 28, 2022, 8:51am UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/7 "2022-05-28T08:51:43Z")

</div>

this is just my opinion. i think you should stick to using radio buttons for single choices and check boxes for multiple choices. it has already been a standard accepted by default. you will only confuse your user if you present check boxes but they don’t behave the way they should…

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 28, 2022, 10:27am UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/8 "2022-05-28T10:27:11Z")

</div>

> [@manyone](#):
>
> using radio buttons for single choices and check boxes for multiple choices

As far as I know Thunkable does not provide the `radio option`. Of course you can use a button and shape it round to look like a radio button but it will not automatically function as a radio button. You still need a similar code to function in the way users will expect it to be,

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 28, 2022, 8:48pm UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/9 "2022-05-28T20:48:51Z")

</div>

this demo shows an example of using radio buttons:  
[https://x.thunkable.com/copy/9d16caa10bd335e62b114239ee587890](https://x.thunkable.com/copy/9d16caa10bd335e62b114239ee587890)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/9/39ef4868879fb4a0cf251ace76322e280d72098c.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 28, 2022, 8:59pm UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/10 "2022-05-28T20:59:15Z")

</div>

I used to make checkboxes this same way!! Nice example

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 26, 2022, 8:59pm UTC](https://community.thunkable.com/t/using-checkboxs-like-option-buttons/1897163/11 "2022-08-26T20:59:48Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
