Advertisement
lalatino

jquery-ui dialog box example

Jul 10th, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.17 KB | None | 0 0
  1. <?php
  2. if (isset($_GET['q'])) {
  3.     echo 'PHP Received q='.$_GET['q'];
  4.     exit;
  5. }
  6. ?>
  7.  
  8. <html>
  9. <head>
  10. <style>
  11.  
  12. #container div { position: relative; }
  13.  
  14. </style>
  15. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
  16. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  17. <script type="text/javascript">
  18.  
  19. $(function(){
  20. $('#dialog_link').click(function() {
  21.  
  22. var qS = $('#qsearch').val();
  23. $.ajax({
  24.     type:"GET",
  25.     url:"",
  26.     data: { q: qS },
  27.     success: function(data) {
  28.     //alert('Javascript got '+data);
  29.         // Dialog
  30.         $('#dialog').dialog({
  31.             autoOpen: true,
  32.             width: 880,
  33.         });
  34.     $('#dialog').html(data);
  35.     }
  36. });
  37. });
  38. });
  39.  
  40. </script>
  41. </head>
  42.  
  43. <body>
  44.  
  45. <div class="search">
  46. <form id="quick-search" method="get" onsubmit="return false;">
  47. <p>
  48. <label for="qsearch">Search:</label>
  49. <input class="tbox" id="qsearch" type="text" name="q" value="Keywords"  />
  50. <input class="btn" alt="Search" id="dialog_link" type="image" title="Search" src="./css/search.gif" />
  51. </p>
  52. </form>
  53. </div>
  54.  
  55. <div id="dialog" title="Search Youtube"></div>
  56.  
  57. </body>
  58. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement