title: Extract value from select/option tag in php?
body: <p>I am not exactly how to do it and how to word the question, so i shall try my best (PS: i'm new to web dev, so please be clear in your answers if you could).</p>
  
  <p>So, I have got a drop down menu with the list names, which are taken from my database. In that database i have a table with names column (the ones that are rendered to the dropdown box) and relevant information to those names. Now, I want that relevant information to appear below in a  tag when a user choose one of those names. I also cannot use the form.submit() method because my submit button is already taken for something else.</p>
  
  <p>Here is the code to that bit:</p>
  
  <pre><code>&lt;form name="name_choice" method="post" action="index.php"&gt;
       &lt;select name="names" onchange="form.some_method()"&gt;
        &lt;option value="NULL" selected="selected"&gt;--Select name--&lt;/option&gt;
         &lt;?php
              for ( $i = 0; $i &lt; $numrows; $i++ ) { //for all the columns, iterate and print out                  
                          $id_names = mysql_result($result, $i);
              echo "&lt;option value='".$id_names."'&gt;".$id_names."&lt;/option&gt;";
          }
          ?&gt;
   &lt;/select&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>So the bit above works fine, but the "some_method()" is my problem, i don't know what to trigger to display the text in the div below the drop down box (code is below for it):</p>
  
  <pre><code>&lt;div class="information"&gt; &lt;!--if the name is chosen ONLY!--&gt;
      &lt;?php
      if($_POST['names'] == "NULL") {
           echo '&lt;p&gt;Please select an option from the select box.&lt;/p&gt;'; //this bit is for testing
      }
      else {
           echo '&lt;p&gt;You have selected: &lt;strong&gt;', $_POST['names'], '&lt;/strong&gt;.&lt;/p&gt;';
                   //and then how to echo the relevant information?:(
      }                   
      ?&gt;
  &lt;/div&gt;&lt;!--end of possible info--&gt;
  </code></pre>