1
I have the following problem: I have to display a popup to wait for the registration of a password by the user. I did so:
<div id="modalSenha" style="display: none;">
<!-- Modal content -->
<div class="modal-content">
Digitação de Senha
<span class="close">×</span>
<br/>
<br/>
<ul class="nav">
<li>
<div class="w3-section">
<label style="font-size: 16px; font-weight: bold;">Por favor, digite a senha...</label>
</div>
</li>
</ul>
</div>
</div>
This popup only appears when the user clicks in the field of my form to enter the password.
How do I make this popup stay open while the user is not finished registering the password?
As soon as he finishes typing the password in the field, the popup has to close. I researched and saw that this has to do with async functions, Promise, etc. I even understood the concept a little bit, but I couldn’t implement it. Could someone please help me?
Do you want to use Promisse to do this? Because you do not put a close button for the user to click when you finish filling the password?
– LeAndrade
so, because we don’t want this job to stay with the user, we want the popup to automatically close on the return of the function that evaluates whether the password was registered correctly. The function that does this evaluation is already done, but my popup does not "wait" this function to run; the popup "opens", the function that evaluates the password returns and, in the line below, I already close the popup. That is, the popup "opens", but closes soon after; so fast that it is not visible on the page :'(
– Renan
Could enter in the question the code referring to the function that evaluates if the password has been filled?
– LeAndrade
The question is, how do you know that the user has finished typing? He does not press a Register/Confirm button?
– Giuliana Bezerra
So the process is actually more complex. My page calls a communication with a mobile device where the user actually enters the password. In the return that this device gives to me, is that I know if the password was registered correctly, so it is bad to understand and post code, even because this verification function is with another developer, who wrote the communication with the mobile device. But for example, let’s say the user, when leaving the field, triggers this verification function. How I close the popup only after this function runs?
– Renan