title: searching without clicking a button
body: <p>I need help. I want to input a letter or letters into a textbox then I need all the names that have those letters appear in the table without clicking any button, how can I do that?</p>
  
  <p>this is my code</p>
  
  <pre><code>&lt;html&gt;
  
      &lt;body&gt;
  Name:    &lt;input type="text" name="text2" id="text2"&gt;
          &lt;div id="table-scroll"&gt;
          &lt;table cellpadding="8" cellspacing="5" id="fo"&gt;
           &lt;thead&gt;
             &lt;tr&gt;
             &lt;th&gt;Patient Number&lt;/th&gt;
             &lt;th&gt;Patient Name&lt;/th&gt;
              &lt;/tr&gt;
              &lt;/thead&gt;
             &lt;tbody cellpadding="8"&gt;
              &lt;?php 
               include( 'connect.php');
                $term=$ _POST[ "text2"];
                $sql="SELECT * FROM tblnpatient WHERE pname LIKE '%$term%'" ;
                $result=m ysql_query($sql); 
                while($row=m ysql_fetch_array($result)) { 
                  echo '&lt;tr class="record"&gt;'; 
                  echo '&lt;td&gt;'.$row[ 'pname']. '&lt;/td&gt;';
                  echo '&lt;td&gt;'.$row[ 'pnum']. '&lt;/td&gt;'; 
                } 
          ?&gt;
   &lt;/tbody&gt;
  
  &lt;/html&gt;
  </code></pre>