I got a BootBox API just for the prompt , but the problem is that in this syntax it has a callback and with it, it only runs the code the second time that I click the button. Of course, I wanted him to execute on the first click. (with the normal prompt in JavaScript works the way I want, but that's awful prompt )
Follow 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;
}