0
I took a Bootbox API just for the prompt, but the problem is that this syntax has a callback and with that, it only executes the code the second time I click on the button. Logically, I wanted it to run on the first click. (with the prompt normal in Javascript works as I want, but it’s horrible this prompt)
Follows the code:
function valida2(){
bootbox.prompt({
title: "This is a prompt with a number input!",
inputType: 'number',
callback: function (result) {
Tips = parseInt(result);
console.log(Tips);
}
});
}
//a função que chama esse prompt
function ccck(){
valida2();
myArray[count] = [count + 1, 1 , Tips, "-"];
sum += Tips;
}
the question is that the code continues, "does not wait to execute the callback". I guess I still don’t quite understand how it works, so I’m not being able to implement
– Neto Davi