title: php Dropdown Realtime Update
body: <p>My apologies if this has been answered before but I did do a search and haven't seen any answers for the questions asked in other posts. The answers I did see didn't relate to my question (mostly to do with dropdowns getting results from mysql).</p>
  
  <p>I have a php dropdown list where you need to select a value (1, 2 or 3). Based on what you select, the list should update a variable and show a hidden div tag. Now from the information I gathered it seems like this cannot be done with php alone but requires a javscript or ajax script.</p>
  
  <p><strong>php:</strong></p>
  
  <pre><code>&lt;form&gt;
      &lt;select name="options" onchange="{dosomething}"&gt;
          &lt;option value="0"&gt;[Select value]&lt;/option&gt;
          &lt;option value="1"&gt;1&lt;/option&gt;
          &lt;option value="2"&gt;2&lt;/option&gt;
          &lt;option value="3"&gt;3&lt;/option&gt;
       &lt;/select&gt;&lt;br&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This should then update this variable and div in REALTIME:</p>
  
  <pre><code>&lt;div id="test" style="display:none"&gt;
      $answer= 1 + $value
      &lt;?php
          echo "1 + $value = $answer";
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>javascript/ajax:</strong></p>
  
  <pre><code>&lt;script&gt;
      function dosomething {
          #update $value based on dropdown and do calculation
          #unhide div with id "test"  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I need to mention that I have no knowledge of javascript or ajax.</p>