title: jquery ajax return values into html form
body: <p>I need help with returning values from <code>jQuery/AJAX</code> to <code>html</code> form inside <code>index.php</code></p>
  
  <p><strong>index.php :</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(document).ready(function () {
    $('#display').ready(function () {
      var pageid = '&lt;?php echo $_GET[\'ID\'] ;?&gt;';
      var powiat = '&lt;?php echo $row[\'powiat\'] ;?&gt;'
      $.ajax({ //create an ajax request to display.php
        type: 'GET',
        url: 'display.php?ID=' + pageid + '&amp;powiat=' + powiat,
        dataType: 'html', //expect html to be returned                
        success: function (response) {
          $('#responsecontainer').html(response);
          //alert(response);
        }
      });
    });
  });
  (...)
  echo "&lt;form  action=\"save.php\" method=\"GET\"&gt;";
  echo "&lt;tr&gt;&lt;td&gt;IP&lt;/td&gt;&lt;td&gt;&lt;div id=\"responsecontainer\"&gt;&lt;/td&gt;&lt;/tr&gt;";
  echo "&lt;input type=\"submit\" value=\"Save\"&gt;" ;
  echo "&lt;/table&gt;&lt;/form&gt;
  </code></pre>
  
  <p><strong>display.php file contains:</strong></p>
  
  <pre><code>$disp_result_2 = mysql_query("SELECT ip FROM swittche_ip WHERE powiat LIKE '%$disp_powiat%' AND ip NOT IN ( SELECT ip FROM switche )" )or die(mysql_error());
  while($disp_row_1 = mysql_fetch_assoc($disp_result_2)){
      echo "&lt;option value=\"".$disp_row_1['ip']."\"&gt;".$disp_row_1['ip']&lt;/option&gt;";
  }
  </code></pre>
  
  <p>In return I have filed <code>html</code> as expected but when I try submit form filed by <code>jquery/ajax</code> I have error </p>
  
  <blockquote>
    <p>Notice: Undefined index: ip. </p>
  </blockquote>
  
  <p>How can I handle with that?</p>
  
  <p>Thanks.</p>