title: Jquery Form disappears after one submission
body: <p>I have a situation where the forms on my page disappear after a single submission of each form. For example, a log-in prompt displays (using Jquery Mobile) for username and password, the dialog box displays normally, the input is processed and validated, the main page is displayed upon successful login. However, if I logoff and then attempt to log back in again, only the page header is displayed. The input fields and the labels are not there.</p>
  
  <p>I have another page where there is a single input field, text is entered into it, the $.post call is made, HTML is returned and a  element is updated with the results using the $('#results').html(dataReceived) function call. </p>
  
  <p>The form seems to be disappearing when the results are displayed. This is the page text:</p>
  
  <pre><code>&lt;div data-role="page" id="Search" data-title="Search"&gt;
  &lt;div data-role="header" data-theme="e"&gt;
  &lt;h1&gt;Search&lt;/h1&gt;                
  &lt;/div&gt;
  &lt;div data-role="content"&gt;                
  &lt;form name="SearchForm" action="search.php"&gt;
  SSN: &lt;input type=number name="snum" size="9" value=""&gt;&lt;br&gt;
  &lt;input id="SearchButton" type="submit" value="Begin Search" data-inline="true"&gt;
  &lt;/form&gt;
  &lt;div id=SearchResults&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;!-- /content --&gt;
  &lt;/div&gt;&lt;!-- /Search --&gt;
  </code></pre>
  
  <p>I intercept the submit event of the form and handle it somewhere else. The code that sets the div contents in the call back function of the $.post AJAX call is:</p>
  
  <pre><code>$('#SearchResults').html(dataReceived);
  </code></pre>
  
  <p>General information: Most recent stable version of jquery and jquery mobile. This is a multi-page file. No external pages are called. Everything is done with $.post calls. The login form does not update any HTML, it simply receives the ID of the user and stores it in a variable.</p>
  
  <p>Any help would be appreciated. Google has not been my friend in this.</p>
  
  <p>Amended to show form submission code:</p>
  
  <pre><code>$(document).ready(function() {
          $('form').submit(function(event) {
                  event.preventDefault();
                  var thisForm=$(this);
                  var formUrl=thisForm.attr('action');
                  var formName=thisForm.attr('name');
                  var dataToSend=thisForm.serialize();
                  var callBack=function(dataReceived) {
                          thisForm.hide();
                          switch(formName) {
                              case 'loginForm':
                              if (dataReceived.length&gt;0 &amp;&amp; parseInt(dataReceived)&gt;0) {
                                     loggingIn=0;
                                     userId=parseInt(dataReceived);
                                     $.mobile.changePage("#home");
                                     break;
                              }
                              thisForm.show();
                              break;
  
                              case 'SearchForm':
                                      $('#SearchResults').html(dataReceived);
                                      break;
                          }
                  };
                  dataToSend += '&amp;seid=' + SESSID;
                  var rtnType="html";
                  switch(formName) {
                          case "loginForm":
                                  rtnType="text";
                                  break;
                          case 'SearchForm':
                                  break;
                  }
                  $.post(formUrl,dataToSend,callBack,rtnType);
                  return false;
          });
  </code></pre>