title: JavaScript: Check/Uncheck box depending on dropdown menu selection
body: <p>I am trying to get a check box to tick its self if a drop down list item is selected. For example, if 'Entry 0' is selected in the drop down, i want the check box '0 is selected' to be checked. Also, if an entry other than 'Entry 0' is selected, I want the check box '0 is selected' to be unchecked. The code i have uses 2 drop down menu items, and 2 corresponding check boxes. Currently only check box 1 works, and does not deselect when another drop down item is selected.</p>
  
  <p>I have searched the net and google for hours and cannot seem to find a solution. I am new to JavaScript, but need this for an online form. (once I understand how to get this solution working, I should be able to put it into my online form.)</p>
  
  <pre><code>&lt;body&gt;
  &lt;script language="JavaScript"&gt;
  function onChange() {
     if (document.formName3.selectName3 = 'Entry 0')
   //{ alert("Option changed")
  { document.formName3.c_0.checked = true;
   document.formName3.c_1.checked = false;
  }
    else if (document.formName3.selectName3 = 'Entry 1')
   //{ alert("Option changed")
  {document.formName3.c_1.checked = true;
   document.formName3.c_0.checked = false;
   }}
  { alert("Begin")
   document.formName3.c_1.checked = true;
  }
  &lt;/script&gt;
  
  &lt;form
    name="formName3" id="formName3"
    onSubmit="return false;"
  &gt;
    &lt;p&gt;
    &lt;select
    name="selectName3"
    onChange="onChange()"
  &gt;
      &lt;option
    value="Option 0" selected="selected"
  &gt;
        Entry 0
        &lt;option
    value="Option 1"
  &gt;
        Entry 1
      &lt;/select&gt;
  
  
    &lt;p&gt;
      &lt;input name="c_0" type="checkbox" id="c_0" /&gt;
      &lt;label for="c_0"&gt;0 Is selected&lt;/label&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;input name="c_1" type="checkbox" id="c_1" /&gt;
      &lt;label for="c_1"&gt;1 Is selected&lt;/label&gt;
    &lt;/p&gt;
  &lt;/form&gt;
  &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Can you let me know how to get it working please? Once I understand how to do this, i can apply it as a feature to my online form.
  Thanks!!!</p>