Sorry, I can't wait around... Here is the code that I mentioned in my comment above. jsFiddle live example here.
This is a fully working, stand-alone example. Just copy/paste into a file and run.
Note that you must reference / load the jQuery and jQueryUI libraries before the code itself (done here in the tags).
Honestly, prompt() is a bad idea for websites these days. Perhaps this is more like what you want to do. Validation (of what the user typed) is done in the close section of the dialog.
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script type="text/javascript">
$(document).ready(function() {
$('#mybutt').click(function() {
$('#msg').dialog({
autoOpen:true,
modal:true,
title: 'This is a question:',
buttons: {
Go: function() {
$(this).dialog('close');
}
},
close: function() {
var s = $('#sumpin').val();
if (s.length<15)
alert('Please type more than 15 characters');
else
alert('You typed: ' + s);
}
});
});
}); //END $(document).ready()
</script>
</head>
<body>
<div id="msg" style="display:none">
Type something here:<br />
<input id="sumpin" type="text">
</div>
<br />
<input type="button" id="mybutt" value="Click Me">
</body>
</html>
window.promptfunction? developer.mozilla.org/en-US/docs/Web/API/window.prompt. If yes, there is no way to validate the input while typing. You can only validate the value after the user submits the value.close:routine of the dialog. It really is simpler than it sounds -- Try this jsFiddle. If you agree, then I'll post a standalone answer (you can figure it out, but it helps to see the <head> and sections that jsFiddle hides.