title: Disabling form elements using an onChange event in JavaScript
body: <p>I'm trying to disable and enable form elements using a JavaScript function. The function is called when certain combo box values are selected. My code is able to enter the functions that disable and enable the elements, but the elements never change state. I've tested my code on another test page and it works successfully.</p>
  
  <p>Here's some of my code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function EnableMonsterFields(value)
      {
          if(value == "Monster Card")
          {
              document.getElementById("monsterCardType").disabled = false;
              document.getElementById("level").disabled = false;
              document.getElementById("monsterClassification").disabled = false;
              document.getElementById("monsterAttribute").disabled = false;
              document.getElementById("rank").disabled = false;
              document.getElementById("qATK").disabled = false;
              document.getElementById("qDEF").disabled = false;
              document.getElementById("ATK").disabled = false;
              document.getElementById("DEF").disabled = false;
          }
      }
  
      function DisableMonsterFields(value)
      {
          if(value != "Monster Card")
          {
              document.getElementById("monsterCardType").disabled = true;
              document.getElementById("level").disabled = true;
              document.getElementById("monsterClassification").disabled = true;
              document.getElementById("monsterAttribute").disabled = true;
              document.getElementById("rank").disabled = true;
              document.getElementById("qATK").disabled = true;
              document.getElementById("qDEF").disabled = true;
              document.getElementById("ATK").disabled = true;
              document.getElementById("DEF").disabled = true;
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And my onChange call:</p>
  
  <pre><code>         &lt;tr&gt;
              &lt;td&gt;Card Type&lt;/td&gt;
              &lt;td&gt;&lt;select name="cardType" id ="cardType" onChange="EnableMonsterFields(this.value); DisableMonsterFields(this.value)"&gt;
                      &lt;option selected value ="Choose One"&gt;Choose One&lt;/option&gt;
                      &lt;?php 
                              while ($row = mysqli_fetch_array($resultSet))
                              {
                              echo ("&lt;option value='" .$row['cardType'] ."'&gt;" . $row['cardType'] . "&lt;/option&gt;");  
                              }
                       ?&gt;
                  &lt;/select&gt;
               &lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p>Any ideas?</p>