title: get values to select in onchange of Multi select box with Jquery
body: <p>trying get values to <code>&lt;select&gt;</code> onchange of other <code>&lt;select&gt;</code> tag values. I have tow dropdown list called vehicle_type and part_type. what i want to do when select the vehicle type and part type need change the part name dropdown list. It is different to vehicle type  and part type combination. So I wrote following code. Could some one help me to find the error of this code. And I'm new to jquery</p>
  
  <p>my html</p>
  
  <pre><code>&lt;div&gt;
                      &lt;label&gt;Vehicle Type&lt;/label&gt;
                      &lt;label&gt;
                          &lt;select name="vehicle_type" id="vehicle_type" required&gt;
                            &lt;option value='' disabled selected style='display:none;'&gt;Select Vehicle&lt;/option&gt;
                            &lt;option value="Car"&gt;Car&lt;/option&gt;
                            &lt;option value="Van"&gt;Van&lt;/option&gt;
                            &lt;option value="SUV/4WD"&gt;SUV/4WD/CAB&lt;/option&gt;
                            &lt;option value="Truck"&gt;Truck&lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;label&gt;Part Type&lt;/label&gt;
                      &lt;label&gt;
                          &lt;select name="part_type" id="part_type" required&gt;
                              &lt;option value='' disabled selected style='display:none;'&gt;Select Part Type&lt;/option&gt;
                              &lt;option value="Engine"&gt;Engine&lt;/option&gt;
                              &lt;option value="Body"&gt;Body&lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;label&gt;Part Name&lt;/label&gt;
                      &lt;label&gt;
                          &lt;select name="part_name" id="part_name" required&gt;
                              &lt;option value='' disabled selected style='display:none;'&gt;Select Part Name&lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/label&gt;
                  &lt;/div&gt;
  
  #dropdown.js
  function setSelect(vehicle_type, part_type){
  $.post("dropdown.php",{"vehicle_type":vehicle_type, "part_type":part_type},function(data){
      $("#part_name").html(data);
  });
  }
  
  $(document).ready(function(){
  
  $("#vehicle_type").live('change', function(){
      var vehicle = $(this+"option:selected").val();
  });
  
  $("#part_type").live('change', function(){
      var part = $(this+"option:selected").val();     
  });
  
  setSelect($("#vehicle_type option:selected").val(), $("#part_type option:selected").val());
  });
  </code></pre>
  
  <p>my dropdown.php</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['vehicle_type'])&amp;&amp;isset($_POST['part_type'])){
  
      $vehicle_type =$_POST['vehicle_type'];
      $part_type    =$_POST['part_type'];
  
      if(($vehicle_type=="Car")&amp;&amp;($part_type=="Engine")){
          $partname  = "&lt;option value=\"Engine Head Block\"&gt;Engine Head Block&lt;/option&gt;";
          $partname .= "&lt;option value=\"Engine Complete W/O Gear Box\"&gt;Engine Complete W/O Gear Box&lt;/option&gt;";
          $partname .= "&lt;option value=\"Engine With A/T CVT Gear Box\"&gt;Engine With A/T CVT Gear Box&lt;/option&gt;";
  } elseif(($vehicle_type=="Car")&amp;&amp;($part_type=="Body")){
          $partname  = "&lt;option value=\"Nose Pannel / Parts\"&gt;Nose Pannel / Parts&lt;/option&gt;";
          $partname .= "&lt;option value=\"Front Bumper With Fog Lamp L/R\"&gt;Front Bumper With Fog Lamp L/R&lt;/option&gt;";
          $partname .= "&lt;option value=\"Front Bumper Bracket Retainer L/R\"&gt;Front Bumper Bracket Retainer L/R&lt;/option&gt;";
  }
  </code></pre>
  
  <p>Please tell me the error. I'm new to jquery   </p>