title: Linking radio buttons to dropdown menu
body: <p>I was hoping to complete this little project without using any if/else/while/for/ whatever control flow statements and in just plain javascript but I seem to run into problems. I am just looking to connect the radio buttons to the drop down menu so that when one is clicked, the other is highlighted. For instance, right now I hae it so that when you select an item from the drop down menu using the setRB() function, it sets true the corresponding radio button. </p>
  
  <p>I'd now like to get the radio button to set true to the corresponding dropdown menu item. Can this be done with the conditions above or do I need to use control flow statements (I believe that's what they're all called).</p>
  
  <p>Thanks.</p>
  
  <pre><code>function setRb() {
    //Point to options list
    //var e = document.getElementById('selColors');
    var e = document.jon.resistors;
    //Get value of color selected
    var s = e.options[e.selectedIndex].value;
    //Now get radio button obect and check it
    var c = document.getElementById(s);
    c.checked = true;
  }
  function setList(radio) {
    alert(radio); 
  }
  
  &lt;form name=jon&gt;
      &lt;select id="selColors" name="resistors"&gt;
        &lt;option value="rbBlack"&gt;Black&lt;/option&gt;
        &lt;option value="rbBlue"&gt;Blue&lt;/option&gt;
        &lt;option value="rbBrown"&gt;Brown&lt;/option&gt;
        &lt;option value="rbGrey"&gt;Grey&lt;/option&gt;
        &lt;option value="rbGreen"&gt;Green&lt;/option&gt;
        &lt;option value="rbOrange"&gt;Orange&lt;/option&gt;
        &lt;option value="rbRed"&gt;Red&lt;/option&gt;
        &lt;option value="rbViolet"&gt;Violet&lt;/option&gt;
        &lt;option value="rbYellow"&gt;Yellow&lt;/option&gt;
        &lt;option value="rbWhite"&gt;White&lt;/option&gt;
      &lt;/select&gt;
      &lt;input onclick="setRb()" type="button" value="Submit"&gt;
  
  
  &lt;div&gt;
      &lt;table&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbBlack" value="Black" type="radio" name="colors" /&gt;Black&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbBlue" value="Blue" type="radio" name="colors" /&gt;Blue&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbBrown" value="Brown" type="radio" name="colors" /&gt;Brown&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbGrey" value="Grey" type="radio" name="colors" /&gt;Grey&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbGreen" value="Green" type="radio" name="colors" /&gt;Green&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbOrange" value="Orange" type="radio" name="colors" /&gt;Orange&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbRed" value="Red" type="radio" name="colors" /&gt;Red&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbViolet" value="Violet" type="radio" name="colors" /&gt;Violet&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbYellow" value="Yellow" type="radio" name="colors" /&gt;Yellow&lt;/td&gt;
      &lt;td&gt;&lt;input onclick="setList(this.value)" id="rbWhite"value="White" type="radio" name="colors" /&gt;White&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>