Demo of passing data from main page to dialog box using JQuery

Enter your name inside the textbox and then open the Dialog Box

Your Name


HTML

Your Name <input type=text id=t1><button id="b1">Open Dialog Box</button>
<br><div id=msg></div>
<div id="my_dialog" title="plus2net  dialog">
  <div id=body></div>
</div>

JQuery


<script>
   $(document).ready(function() {
$(function() {
 $( "#my_dialog" ).dialog({
	autoOpen: false
	});
});

$("#b1").click(function(){
$( "#my_dialog" ).dialog( "open" );
$('#body').text('Wait..');
$('#body').text('Welcome ' + $('#t1').val());
})
})
</script>