title: using ajax call to popup jquery dialog form
body: <p>I have a link with get parameters. When I click it, ajax is called. Now when it goes to </p>
  
  <p>action.php, I have a form with php values(from mysql). I want to pop this with jquery </p>
  
  <p>dialog.</p>
  
  <p>I am not sure how to do this.</p>
  
  <pre><code>      &lt;script&gt;
  
  
   $(document).ready(function(){
   $.ajax({
          type: "GET",
          url: this.href,
          cache:false,
          success: function(response){           
              if (response.length &gt; 0) {  
              document.getElementById('display').innerHTML=wrapperelement; 
                  wrapperelement.innerHTML = response; 
                  $( "#dialog-form" ).dialog( "open" );
              }
          }
   });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>updated codes</strong></p>
  
  <p>The body of this file</p>
  
  <pre><code>       &lt;body&gt;
         &lt;div id="display"&gt;&lt;/div&gt;
         echo '&lt;a href="action.php?pldid=' . $pldid . '" class="editbt"&gt;Edit&lt;/a&gt;';
         &lt;/body&gt;
  </code></pre>
  
  <p>So my action.php</p>
  
  <pre><code>   if (isset($_GET['pldid'])&amp;&amp; $_GET['pldid'])
   {
   $form = &lt;&lt;&lt;EOF
  &lt;form&gt;
  &lt;div id="dialog-form" title="Edit Fields"&gt;
    &lt;p class="validateTips"&gt;All form fields are required.&lt;/p&gt;
  
  
  
   &lt;form&gt;
   &lt;fieldset&gt;
   &lt;label for="box"&gt;Box&lt;/label&gt;
   &lt;input type='text' name='box' id='box' class="text ui-widget-content ui-corner-all"   /&gt;
   &lt;label for="itemname"&gt;itemname&lt;/label&gt;
   &lt;input type='text' name='itemname' id='itemname' class="text ui-widget-content ui-corner-all"   /&gt;
  &lt;label for="size"&gt;size&lt;/label&gt;
   &lt;input type='text' name='size' id='size' class="text ui-widget-content ui-corner-all"   /&gt;
  &lt;label for="potency"&gt;potency&lt;/label&gt;
   &lt;input type='text' name='potency' id='potency' class="text ui-widget-content ui-corner-all"   /&gt;
  &lt;label for="quantity"&gt;Quantity&lt;/label&gt;
   &lt;input type='text' name='quantity' id='quantity' class="text ui-widget-content ui-corner-all"   /&gt;
  
   &lt;/fieldset&gt;
   &lt;/form&gt;
  
  &lt;/div&gt;
  EOF;
  echo $form;
  }
  </code></pre>
  
  <p>I want the link to open up a window with form(values from mysql). Any suggestion is highly welcomed..Thanks you..</p>