# \[Solved\] Prevent Multiple Button Click

**URL:** <https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [June 14, 2019, 8:38am UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902 "2019-06-14T08:38:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 8:38am UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/1 "2019-06-14T08:38:38Z")

</div>

Hi

I was going through the Quiz App video and noticed a small issue. When you click the correct answer I noticed I could still click the button multiple times until the next question appears and this obviously increases the score.

How do I block the click feature on a button for few seconds before the next question is displayed.

[![](https://img.youtube.com/vi/Yah0bKzHIng/hqdefault.jpg "Build your own Quiz App") ](https://www.youtube.com/watch?v=Yah0bKzHIng)

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 14, 2019, 9:45am UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/2 "2019-06-14T09:45:52Z")

</div>

Hi there,

Good catch!

Buttons have a property called ‘Disabled’ which stops them from responding to being clicked.

![disableButton](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/1/31bd1223b739cc5ae5e6d6d7a2bb68c6d982236c.png)

When an answer is selected, you could disable all of the Buttons on your Screen by setting ‘Disabled’ to true. When the next question is loaded, you can enable all of the Buttons again by setting 'Disabled to false 😀

---

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 9:48am UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/3 "2019-06-14T09:48:12Z")

</div>

ahhh mama mia, I was just looking at that option while searching. Thanks

---

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 10:04am UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/4 "2019-06-14T10:04:30Z")

</div>

The only down side to this is the disable button option removes the answer color highlights.

Can we have a disable click feature rather than disable button alone?

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 14, 2019, 10:14am UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/5 "2019-06-14T10:14:10Z")

</div>

If you want to keep the appearance of the Button intact, you could use a Boolean: a variable whose only possible values are true or false.

You can initialize an app variable answerNotSelected to true.  
When the user has selected an answer, set answerNotSelected to false.  
When a new question opens, set answerNotSelected to true again.

Then just put whatever blocks you have for your Buttons inside an if block that says ‘if answerNotSelected’.

This will disable the effects of your Button once an answer has been selected without changing its appearance.

---

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 1:13pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/6 "2019-06-14T13:13:10Z")

</div>

Block view of what you need to do based on @jane reply:

1. First initialize a variable and set it to FALSE. I called mine “answerSelected”. This means I have not clicked on any answer button, so everything is normal.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/38492337508884cb67a23f5addfb43cc149b6264.png)

1. Next on button click block, add an if statement and check if the variable is still false. If FALSE, then everything inside the block will take immediate effect

2. Immediately after the IF statement, add set variable block to TRUE. This would ensure that if you try to click the button immediately while the answer is been processed, nothing will happen to the button

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5b87da720ccd92630ce8f2e339766c612281b038.png)

1. Lastly you need to set the variable back to FALSE so we can click on buttons again. Add this at end of the “Update quiz for each question” block

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/669abdfdaa91be8a5fda0e60922f95a2047e0dbd.png)

Hope this helps visually.

**The next bit I need to figure out is when I exit question halfway and come back to it, I want it to restart question from beginning and not from where I last was.**

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 14, 2019, 1:15pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/7 "2019-06-14T13:15:48Z")

</div>

Looks great!

What does starting a question from the beginning mean here?

---

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 1:19pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/8 "2019-06-14T13:19:28Z")

</div>

Basically in my app, I have an Exit screen

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/f/cf02416890233c4222f64f8993c07382cdb5cd1c.png)

So when I click on YES, it takes me to Home Screen  
Click on No, it takes me back to game screen

The issue with Home Screen which is also my Menu screen with a Play button which goes to game screen, is when I click Play, it takes me to game screen but continues from last question before I exited rather than restarting questions from 1

---

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 1:21pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/9 "2019-06-14T13:21:52Z")

</div>

Ah actually I think I found an answer in block in Game Over screen. Reset question variable back to 1 and also score.

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 14, 2019, 1:25pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/10 "2019-06-14T13:25:07Z")

</div>

SO you want to restart the whole quiz - that makes more sense 😁 resetting the question variable to 1 is exactly what I’d recommend!

---

<div class="post-metadata">

**Author:** ![sysads](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sysads/32/44975_2.png) [@sysads](https://community.thunkable.com/u/sysads)\
**Post date:** [June 14, 2019, 1:25pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/11 "2019-06-14T13:25:53Z")

</div>

No it didn’t work as expected. When I click Yes, it resets question back to question 1 but then the score at first resets to 0 but then changes to last score

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [June 14, 2019, 1:28pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/12 "2019-06-14T13:28:36Z")

</div>

Can you message me a share link to your app so I can see what your blocks look like?

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:13pm UTC](https://community.thunkable.com/t/solved-prevent-multiple-button-click/105902/13 "2024-11-08T12:13:28Z")

</div>


