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
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, 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??
cardst.lenghtshould becardst.length; Also, not sure of the reason for creating a new string.