title: Javascript number is NaN
body: <p>I've been looking around and I can't seem to find out why this is happening or how to fix it. I've been trying different things for about 2 days, now its time to ask for help before I rip the rest of my hair out (I'm new to Java)</p>
  
  <p>I know the code is very long winded at the moment, but its like that for readability to see why its not working for me.</p>
  
  <pre><code>     function getBaB()
  {   
        var BaB=0;
        var theForm = document.forms["prrform"];
        var basebab = theForm.elements["charbab"];
        BaB = basebab.value;
        return BaB;
  }
  
   var armour_types = new Array();
  </code></pre>
  
  <p>//This is the bit that doesn't work</p>
  
  <pre><code> armour_types["Heavy"] = (getBaB.value) ;
  </code></pre>
  
  <p>//It just returns undefined, and if I parseInt then I get NaN. I just can't see why it isn't defined.</p>
  
  <pre><code> armour_types["Medium"] = 10;
   armour_types["Light"] = 2;
   armour_types["Adamantine"] = 10;
   armour_types["Mithral"] = 5;
   armour_types["Unarmoured"] = 0;
  
  
  function calculateTotal()
  {
     var TotalPRR = getArmourType();
      var divobj = document.getElementById('totalPRR');
      divobj.style.display='block';
      divobj.innerHTML = "Total PRR "+TotalPRR;
  
  }
  
  function hideTotal()
  {
      var divobj = document.getElementById('totalPRR');
      divobj.style.display='none';
  }
  </code></pre>
  
  <p>I can post the HTML if needed.</p>
  
  <p>Thanks in advance :</p>