title: Get selected select value from a listbox with mysql data to open another listbox and fetch mysql data using this value
body: <p>Im starting in javascript so, I need to do this : From a list box(already has mysql data using php) I want to get the current selection id (select,selected I think in Java) and fill a listbox with data using the id of the first listbox.But this must happens on onChange property of the listbox1 but on selection.
  Here is what I have so far
  Html code 
      
      Select a Region
      
  
  <pre><code>$result_disp = mysql_query($query_disp, $cn);
  $res=mysql_select_db("xxxx",$cn) or die("Note: " . mysql_error());
  
  $res=mysql_query("select Region_ID, Region_Description from regions");
  while($query_data = mysql_fetch_array($res))
  {
  ?&gt;
  
  &lt;option value="&lt;? echo $query_data["Region_ID"]; ?&gt;"
  &lt;?php if ($query_data["Region_ID"]==$_post['Region_ID']) ?&gt;&gt;
  &lt;? echo $query_data["Region_Description"]; ?&gt;&lt;/option&gt;
  &lt;? } ?&gt;
  &lt;select name="Dep" id="Items"&gt;
  &lt;option&gt;Département&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>javascript </p>
  
  <pre><code>function setSelect(id,value) {
  var sel = document.getElementById(id);
  var option, options = sel.options;
  var i = options.length;
  while (i--) {
  option = options[i];
  option.selected = (option.value == value)? true : false;
  
  }
  }
  </code></pre>
  
  <p>thanks in advance!</p>