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
Post a Comment