title: form disappears when it is submitted in PHP
body: <p>I've got the following in my code and I cant get to work the latter part of the code work. To be more precise on my question, this works the way I want up until I click <code>OneClick</code>. When that's done I get another form (form2) with a <code>TwoClick</code> submit button dynamically populated. The issue comes here. When I click the button <code>TwoClick</code> the whole 'form2' disappears. can some one throw me a clue as to where I have gone wrong?</p>
  
  <p>Thanks.</p>
  
  <pre><code>    &lt;?php session_start(); ?&gt;
  &lt;DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="One"&gt;
      &lt;form name="form1" method="post" action="#"&gt;
          &lt;?php echo "&lt;input type='text' name='txt1' id='txt1'&gt;"; // This text box is dynamically populated ?&gt;
                &lt;input type="submit" name="sendone" id="sendone" value="OneClick"&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;div id="two"&gt;
  
  
              &lt;?php
              if(isset($_POST['sendone']))
              {   if($_POST['txt1'] == '')
                  {echo 'txt1 is empty!'; return;} else {$_SESSION['txt1'] = $_POST['txt1'];}
  
                          if(isset($_SESSION['txt1'])) 
                          echo $_SESSION['txt1']; 
                          echo "&lt;form name='form2' method='post' action='#'&gt;&lt;table border='1'&gt;&lt;tr&gt;&lt;td&gt;form 2 is here!&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;input type='text' name='txt123' id='txt123'&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type='submit' name='sendtwo' id='sendtwo' value='TwoClick'&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;";
  
  
  
              }   
                          if(isset($_POST['sendtwo']))
                          if(isset($_POST['sendtwo'])) 
                          {
                              if($_POST['txt123'] == '')
                              {echo "Text box is empty..."; return;}
                          }               
                          ?&gt;
  
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>