title: Select box enabled through Javascript Function
body: <p>I am trying to enable a select box when an option is selected in another select box. In this case, when a user selects R or C in the first select box, the second box should be enabled. I have attempted to replicate the solution here: <a href="https://stackoverflow.com/questions/12269470/selectbox-disabled-or-enabled-by-an-option-of-an-other-selectbox">Selectbox disabled or enabled by an option of an other selectbox</a>, however the form I am using is set up for submit and rest buttons, as well as many other input and select fields. I am also very new to Javascript and HTML so if there is something silly that I have done, I won't be entirely surprised.</p>
  
  <p>My Javascript function is the following, which is placed after the HTML body code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      document.getElementById("part").onchange = function () 
      {       
          if (document.getElementById("part").value == "R" || document.getElementById("part").value == "C") 
          {
              document.getElementByID('part_number').disabled = false;
          }
          else 
          {
              document.getElementByID('part_number').disabled = true;
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And the select boxes are:</p>
  
  <pre><code>&lt;select class="form-control" name="part[]" id="part" style="display: inline-block; width: 50%;" data-index="1"&gt;
      &lt;option value disabled selected&gt; -- Select a part -- &lt;/option&gt;
      &lt;option value='R'&gt;R&lt;/option&gt;
      &lt;option value='C'&gt;C&lt;/option&gt;
  &lt;/select&gt;
  &lt;select multiple class="form-control" name="part_number[]" id="part_number" style="display: inline-block; width: 50%;" disabled&gt;
      &lt;option value disabled selected&gt; -- Select a part -- &lt;/option&gt;
      &lt;?php for ($i = 1; $i &lt; 100; $i++){?&gt;
      &lt;option value="&lt;?php echo $i; ?&gt;"&gt;&lt;?php echo $i; ?&gt;&lt;/option&gt;
      &lt;?php } ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The second box holds the options 1-99 and is disabled by default. The two text boxes can be replicated many times through a dynamic Javascript function which is why I am using arrays. There are no errors in the console of my browser either. I am using the latest version of Google Chrome. Any help would be greatly appreciated. Thank you.</p>