title: Refresh php content onchange of <select>
body: <p>I'm creating a form with three main fields and several additional fields. One of the main fields is select type and some of the additional fields are also select. The values for all the select fields come from the included .php files which are connected to the database. My goal is to make the additional fields show only the values related to the selection of the main select field. The way I see it is that onClick of the main select I will call a javascript function with ajax, which would send the new value to the same page and refresh the contents of the main div (with all the php included files, which will take the new parameter and show the needed values)</p>
  
  <pre><code>body
    div id=container
     div id=menu
     div id=main
  </code></pre>
  
  <p>All what I know about ajax is how to send variables to the different php page and get echoed response. Can someone explain how to send/change the value of the php variable on the same page while refreshing the certain div. (or may be someone know a better solution for my problem). Thank you for your time!</p>