current_Importance + current_BodyPart

by chayacooper

HTML

<span  id="body_part_info" class="headerFont">
           <span onclick="$('#body_part_primary').show();$('#body_part_muscle_cellulite, #body_part_secondary').hide();">
           <label><input type="radio" name="body_shape_importance" class="show_value" checked="checked" value="Primary Shape" />Primary Shape</label>
           </span>
           <span style="padding-left:10px" onclick="$('#body_part_muscle_cellulite').show();$('#body_part_primary, #body_part_secondary').hide();">
           <label><input type="radio" name="body_shape_importance" class="show_value" value="Tone/Cellulite" />Tone/Cellulite</label>
           </span>
           <span style="padding-left:10px" onclick="$('#body_part_secondary').show();$('#body_part_muscle_cellulite, #body_part_primary').hide();">
           <label><input type="radio" name="body_shape_importance" value="Secondary Shape" /> Secondary Shape</label>
           </span>
</span>

 <div height=35px id="body_part_muscle_cellulite" style="display:none">           
           <select name="body_part" style="width: 9.8em">
           <option value="fitness_level" selected="selected" onclick="$('#muscle_cellulite_description2').show();$('#muscle_cellulite_description1').hide();">Overall</option>
           <option value="thigh_muscle_tone" onclick="$('#muscle_cellulite_description1').show();$('#muscle_cellulite_description2').hide();">Thighs</option>
           <option value="bottom_muscle_tone" onclick="$('#muscle_cellulite_description1').show();$('#muscle_cellulite_description2').hide();">Butt</option>
           <option value="arm_tone" onclick="$('#muscle_cellulite_description2').show();$('#muscle_cellulite_description1').hide();">Upper Arm</option>
           </select>   
           </div>

<select name="body_part" id="body_part_primary" style="width: 9.8em">
           <option value="bust" >Bust</option>
           <option value="Hips">Hips</option> <!-- measurements_hips -->
           <option...

JavaScript

$(function() {
var current_Importance = $('select[name="body_shape_importance"]');
var current_BodyPart = $('select[name="body_part"]');     
//$("#body_part_primary, #body_part_muscle_cellulite, #body_part_secondary").hide();
$("#primary_body_description1, #primary_body_description2, #primary_body_description3, #primary_body_description4, #primary_body_description5").hide();
     
   $('select[name="body_shape_importance"]').change(function () {   
   $("#body_part_primary, #body_part_muscle_cellulite, #body_part_secondary").hide();  
          if( $(current_Importance).val() === "Primary Shape"){       
              $("#body_part_primary").show();              
           } 
         else if( $(current_Importance).val() === "Tone/Cellulite"){       
              $("#body_part_muscle_cellulite").show();              
           }
          else if( $(current_Importance).val() === "Secondary Shape"){       
              $("#body_part_secondary").show();              
           }
         else {                          
   $("#body_part_primary, #body_part_muscle_cellulite, #body_part_secondary").hide();
         }
     });
    
    
     $('select[name="body_part"]').change(function () {   
     $("#primary_body_description1, #primary_body_description2, #primary_body_description3, #primary_body_description4, #primary_body_description5").hide();          
          if( $(current_BodyPart).val() === "bust"){       
              $("#primary_body_description1").show();              
           } 
         else if( $(current_BodyPart).val() === "Hips"){       
              $("#primary_body_description2").show();              
           }
          else if( $(current_BodyPart).val() === "Waist"){       
              $("#primary_body_description2").show();              
           }
          else if( $(current_BodyPart).val() === "stomach"){       
              $("#primary_body_description3").show();              
           }
          else if(...