# Problem of Alert disappear without waiting user confirms

**URL:** <https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139>\
**Category:** Questions about Thunkable X\
**Created:** [July 15, 2019, 2:24am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139 "2019-07-15T02:24:03Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicho9999](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nicho9999](https://community.thunkable.com/u/nicho9999)\
**Post date:** [July 15, 2019, 2:24am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/1 "2019-07-15T02:24:03Z")

</div>

I am a newbie to Thunkable X. I tried to create a simple app that ask user to input name and year of birth, and return a message with the input name and calculated age.  
Before composing the message, I test whether the 2 “TextInput” are blank and show alert if any of them are blank.  
My problem is when both input are blank, the 1st alert disappears before I confirm and the 2nd alert shows waiting for confirmation.  
I run Thunkable Live on an android phone. Could somebody tell me what’s wrong with my code, or is it a bug in thunkable x?

The code is as follows:

 ![thunkable_screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/8/98a1b4346fbe2af6e79a3ce183dc0f14a22794a1.jpeg)

---

<div class="post-metadata">

**Author:** ![Abdelrahman1](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@Abdelrahman1](https://community.thunkable.com/u/Abdelrahman1)\
**Post date:** [July 15, 2019, 4:41am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/3 "2019-07-15T04:41:00Z")

</div>

Hello

Use one block “if + else if + else if”, I think it will work

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 15, 2019, 4:46am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/4 "2019-07-15T04:46:02Z")

</div>

It is not a bug in Thunkable, it is the way you programmed it.

If txt\_Name is empty, then you want an alert. But right after, your logic checks and reports for txt\_BornYear being empty as well; with the second alert then competing with the first for the display.

How would you want it to proceed? If the txt\_Name is empty, to stop processing because there is reason enough to report?

It is all under your control.

---

<div class="post-metadata">

**Author:** ![nicho9999](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nicho9999](https://community.thunkable.com/u/nicho9999)\
**Post date:** [July 15, 2019, 4:48am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/5 "2019-07-15T04:48:18Z")

</div>

Abdelrahman1, thanks for your help. It does work. But I intend to show the 2 messages one by one. With the amendment you suggest, only one message will be shown.

Besides, shouldn’t the Alert waits for my confirmation before going on in the first instance? Sorry for keep on asking, but I just want to learn more about how each component works.

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 15, 2019, 4:49am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/6 "2019-07-15T04:49:06Z")

</div>

No, it should be “if else”. The Err flag is enough to adequately pass the the condition of everything being OK for the processing.

---

<div class="post-metadata">

**Author:** ![nicho9999](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nicho9999](https://community.thunkable.com/u/nicho9999)\
**Post date:** [July 15, 2019, 4:55am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/7 "2019-07-15T04:55:15Z")

</div>

I’m not sure what you mean by “second alert competing with the first for the display”. I just thought that the first alert will wait for my confirmation before going on to execute the following statements, i.e. compare the second field and show alert if needed.

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 15, 2019, 5:07am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/8 "2019-07-15T05:07:21Z")

</div>

No, the waiting for the confirmation is the sub-block “then do when Show is done”, which you may populate with other things.

For instance, you could put the second “if” test in a procedure, that you would call _inside_ that first alert, and in an “else” condition to to the first “if”. If the first est fails, then it will wait for the confirmation before calling the second. And if the first test is a pass (name is not empty), it will immediately move on to the second test by calling the procedure for the second test.

---

<div class="post-metadata">

**Author:** ![nicho9999](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nicho9999](https://community.thunkable.com/u/nicho9999)\
**Post date:** [July 15, 2019, 5:07am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/9 "2019-07-15T05:07:43Z")

</div>

Thanks guys, I got it works now. I moved the 2nd comparison and alert to the “then do” socket of the 1st alert, and got the 2 alerts showing one by one.

Thank you very much for wasting time to answer my silly question, now I understand more about how alert works.

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 15, 2019, 5:11am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/10 "2019-07-15T05:11:30Z")

</div>

Warning: by moving (as opposed to having duplicate calls to, or duplicate second “if”) the second “if” inside the first “if” alert, it will not be tested when the name is not empty but the year is wrong.

---

<div class="post-metadata">

**Author:** ![nicho9999](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nicho9999](https://community.thunkable.com/u/nicho9999)\
**Post date:** [July 15, 2019, 5:20am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/11 "2019-07-15T05:20:35Z")

</div>

Thank you for your reminder. Immersed in finding a way to show both alert, I forgot to test the situation you mentioned. I think I will try your approach of using a procedure.

---

<div class="post-metadata">

**Author:** ![Abdelrahman1](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@Abdelrahman1](https://community.thunkable.com/u/Abdelrahman1)\
**Post date:** [July 16, 2019, 12:24am UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/12 "2019-07-16T00:24:41Z")

</div>

Welcome  
Ok I think i understood u

I have a solution but it will use more blocks  
Use (if and else) to check your first case  
In “if” part, put the alert, inside the alert put the second “if” block

In “else” part, put the second “if” block again

---

<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:12pm UTC](https://community.thunkable.com/t/problem-of-alert-disappear-without-waiting-user-confirms/143139/13 "2024-11-08T12:12:14Z")

</div>


