A similar question was discussed in this topic https://stackoverflow.com/questions/7845866/how-to-set-the-input-value-in-a-modal-dialogue
$('#modal-from-dom').bind('show',function() { $(".modal-body #wall-post").val($("#linkURL").val()); }); <html>
Sample page
<html> <head> <title>Example</title> <script src="scripts/jquery.min.js"></script> <script src="scripts/bootstrap-modal.js"></script> <link rel="stylesheet" href="scripts/bootstrap.min.css"> <link rel="stylesheet" href="main.css" /> <script type="text/javascript"> $(document).ready(function() { $('#modal-from-dom').bind('show',function() { $(".modal-body").html($("#linkURL").val()); }); }); </script> </head> <body> <!-- The Modal Dialog --> <div id="modal-from-dom" class="modal hide fade"> <div class="modal-header"> <a href="#" class="close">×</a> <h3>Add Link</h3> </div> <div class="modal-body"> <!-- <form id='post-on-wall' method='POST' action='savePost.php' enctype='multipart/form-data'>" <input type='text' class='label-inline' name='linkURL' id='wall-post' value=linkURL> </form> --> </div> <div class="modal-footer"> <a href="#" class="btn primary">Add Link</a> </div> </div> <div class="container"> <div class="wall-post"> <textarea class='label-inline' name='linkURL' id='linkURL'></textarea> <button data-controls-modal="modal-from-dom" data-backdrop="true" data-keyboard="true" class="btn">Add Link</button> </div> </div> </body>
In your case, do you want the data entered by the user in the form to appear in the modal window, or would the response from the server be displayed?
If the latter, then you must use AJAX.
Update:
I understand your task. Quickly edited an example.
<!DOCTYPE html> <html> <head> </script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $(function() { $( "#dialog" ).dialog(); }); $.ajax({url: "/system/wpacert", success: function(result){ $("#dialog").html(result); }}); }); }); </script> </head> <body> <div id="dialog" title="Basic dialog"></div> <button>Получить результат</button> </body> </html>