# \[Solved\] How do I prevent a button from being pressed twice or more?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [January 11, 2020, 10:33am UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054 "2020-01-11T10:33:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 11, 2020, 10:33am UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/1 "2020-01-11T10:33:42Z")

</div>

I get a value when I press a button.  
I want to receive once even after pressing several times.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 11, 2020, 4:27pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/2 "2020-01-11T16:27:31Z")

</div>

This is the same as your question about [a first run variable for a guide page](http://community.thunkable.com/t/how-do-i-create-a-guide-page/397028/5). You would use the same blocks to allow a button to “run” (be tapped) only once.

---

<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:** [January 11, 2020, 6:10pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/3 "2020-01-11T18:10:59Z")

</div>

In the on click block, you would disable the button. Then enable the button with some other action in the app, Such as when changing the value of some variable.

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [January 12, 2020, 3:39am UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/4 "2020-01-12T03:39:06Z")

</div>

Hi, @mom7667yafy! 👋

A quick solution for you would be,

Every time the user presses a button, get your value, and disable it.  
Next, only enable it when you want the user to send another value / click one more time.

Thanks! 😊

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 13, 2020, 5:55pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/5 "2020-01-13T17:55:30Z")

</div>

Can anyone show me an example block?  
I still don’t know.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 13, 2020, 7:29pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/6 "2020-01-13T19:29:55Z")

</div>

This is the idea. But I’m not sure a stored variable will initialize to false.

![Screen Shot 2020-01-13 at 11.20.48 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/3/73c0147d66376fbd5dd442a426913dfaee3430e1.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 13, 2020, 7:38pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/7 "2020-01-13T19:38:38Z")

</div>

Oooh, simpler solution:

![Screen Shot 2020-01-13 at 11.27.50 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/4/74e48173c69a34e46530a4dcf8440824c9250f6f.png)

---

<div class="post-metadata">

**Author:** ![exploriverse.com](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/exploriverse.com/32/77609_2.png) [@exploriverse.com](https://community.thunkable.com/u/exploriverse.com)\
**Post date:** [August 14, 2020, 3:38pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/8 "2020-08-14T15:38:22Z")

</div>

This is helpful but visually ‘Disabled = true’ makes the button look washed out and unprofessional.

I’ll look into hiding the button or figuring out a different transition.

---

<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:** [August 14, 2020, 3:49pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/9 "2020-08-14T15:49:33Z")

</div>

what about logic that doesn’t let anything happen unless some other condition is true. or that alerts you “hey, you haven’t done something yet…”

^^^this is the route that I take. make a custom function. use it where needed.  
from whence thunkable does not provide… build

---

<div class="post-metadata">

**Author:** ![hdawc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hdawc/32/119068_2.png) [@hdawc](https://community.thunkable.com/u/hdawc)\
**Post date:** [August 14, 2020, 11:36pm UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/10 "2020-08-14T23:36:56Z")

</div>

I read that as

> “whatever bollocks you want”

😂

---

<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, 11:46am UTC](https://community.thunkable.com/t/solved-how-do-i-prevent-a-button-from-being-pressed-twice-or-more/402054/11 "2024-11-08T11:46:03Z")

</div>


