title: How to open a new form in button click?
body: <p>Hi i am using php where i am using ajax i am retrieving data from database without reloading page i am getting data on same page now i want that when i get data i retrieve in table format then there is update button there when i click on update button a new form should open</p>
  
  <p>Here is code</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  function fun()
  {
  var exam=new XMLHttpRequest();
  exam.onreadystatechange=function()
  {
      if(exam.readyState==4)  
      {
          document.getElementById("res").innerHTML=exam.responseText;
      }
  }
  exam.open("GET","rat_test.php?name=pramod",true);
  exam.send(null);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="" method="post" id="form" name="form"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" onclick="fun();" value="getvalue" /&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;div id="res"&gt;&lt;/div&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>rat_test.php</strong></p>
  
  <pre><code>&lt;table  border="1"&gt;
    &lt;tr&gt;
      &lt;th scope="col"&gt;ID&lt;/th&gt;
      &lt;th scope="col"&gt;Name&lt;/th&gt;
     &lt;/tr&gt;
  &lt;?php
  include("connection.php");
  $sel="select * from info";
  $res=mysql_query($sel);
  while($fet=mysql_fetch_array($res))
  { ?&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="checkbox" name="users[]" value="&lt;?php echo $row["id"]; ?&gt;" &gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php  echo $fet['id']; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php  echo $fet['name']; ?&gt;&lt;/td&gt;
  
    &lt;/tr&gt;
   &lt;?php }
  ?&gt;
  &lt;/table&gt;
  &lt;form action="" method="post" id="form" name="form"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" onclick="fun()1;" value="Update" /&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>here in test_rat.php a <strong>update</strong> button is available i want to open a new form on that update button button</p>
  
  <p>How can i achieve this</p>
  
  <p>Any help will be appreciated</p>