Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. //test.html
  2.  
  3. <!doctype html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="utf-8">
  7. <title>Dialog Box Witout Close Button</title>
  8. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
  9. <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  10. <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
  11.  
  12. </head>
  13. <body>
  14. <button id="dialog_trigger">open the dialog</button>
  15. <div id="dialog" style="display:none;" title="Dialog Title"><iframe src="dialog.html" width="700" height="700" frameborder="0" noresize="noresize" scrolling="no" ></iframe></div>
  16. <script>
  17. $( "#dialog_trigger" ).click(function() {
  18. $( "#dialog" ).dialog( "open" );
  19. });
  20. $("#dialog").dialog({
  21.  
  22.  
  23. autoOpen: false,
  24. position: 'center' ,
  25. title: 'Sample Dialog',
  26. draggable: false,
  27. width : 500,
  28. height : 400,
  29. resizable : true,
  30.  
  31. buttons: {
  32. "Ok": function() {
  33. var first_name = $('input[name=FirstName]').val();
  34. //This returns the value of first name.
  35.  
  36.  
  37. var last_name = $('input[name=LastName]').val();
  38. //This returns the value of last name.
  39. alert( $('input[name=FirstName]').val());
  40. $(this).dialog("close");
  41. }}
  42. });
  43.  
  44.  
  45. </script>
  46. </body>
  47. </html>
  48.  
  49. /***************************
  50. dialog.html
  51. <!DOCTYPE html>
  52. <html>
  53. <body>
  54.  
  55. First name: <input type="text" name="FirstName" value="Mickey"><br>
  56. Last name: <input type="text" name="LastName" value="Mouse"><br>
  57.  
  58. </form>
  59.  
  60.  
  61.  
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement