You can use jQuery Dialog for this.
Here is an example: http://jsfiddle.net/RBKaZ/
Using this HTML
<div id="dialog"> <p>Please enter your name</p> <textarea id="name"></textarea> </div> <label>Name entered: </label> <label id="nameentered"></label> <br /> <input type="button" id="open" value="Open Dialog" />
And this jQuery:
$("#dialog").dialog({ autoOpen: false, buttons: { Ok: function() { $("#nameentered").text($("#name").val()); $(this).dialog("close"); }, Cancel: function () { $(this).dialog("close"); } } }); $("#open").click(function () { $("#dialog").dialog("open"); });
source share