javascript string length returning undefined -


i cant seem string length value in form textfield here's code function, getting passed parameter of textfields name

  function validate(thing)   {    var location = document.getelementbyid(thing);    var cardst = location.value;   window.alert (cardst);   cardst = string(cardst);   window.alert (cardst.lenght); 

the first alert works, alerts whatever type textfield, second 1 undefined. can see did cast string get undefined.. ideas??

that because misspelled length :-)

use instead:

cardst.length;   // <- 'th', not 'ht' 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -