JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://trentrichardson.com/Impromptu/scripts/jquery-impromptu.3.1.min.js"></script>
<link rel="stylesheet" href="http://trentrichardson.com/Impromptu/css/examples.css">
<link rel="stylesheet" href="http://trentrichardson.com/Impromptu/css/screen.css">
JavaScript
var ind = 0;
var values = [];
var count = 3;
function nextPrompt(done)
{
function processPrompt(v, m, f)
{
if(v != undefined)
{
var input = f.alertName;
values[ind] = input;
}
if(++ind < count)
{
nextPrompt(done);
}
else
{
done();
}
}
var txt = 'Please enter value ' + ind + ': <br /><input type="text" id="alertName" name="alertName" value="name here" />';
$.prompt(txt,{
callback: processPrompt,
buttons: { Hey: 'Hello', Bye: 'Good Bye' }
});
}
nextPrompt(function()
{
for(var i = 0; i < count; i++)
{
alert(values[i]);
}
});