title: javascript string length returning undefined
body: <p>I cant seem to get a string length from a value in a form textfield
  Here's the code for my function, its getting passed the parameter of the textfields name</p>
  
  <pre><code>  function validate(thing)
    {
  
    var location = document.getElementById(thing);
  
    var cardst = location.value;
    window.alert (cardst);
    cardst = String(cardst);
    window.alert (cardst.lenght);
  </code></pre>
  
  <p>the first alert works, it alerts whatever I type into the textfield, but the second one is always undefined. As you can see I did cast it as a string but I get get undefined.. ANy ideas??</p>