Click to See Complete Forum and Search --> : Where is the error?


vitorpt
07-07-2003, 07:04 AM
I have this script that isn't working correctly

<script language="Javascript">
function verify() {
var n=document.frm.cnome.lenght;
if (n>5) {
document.frm.submit();
return true;
}
else {
alert("Field too small..");
return false;
}
}
</script>

It seems that n is always less than 5 no matter in put in the field.

Thanks

SlankenOgen
07-07-2003, 07:36 AM
spelling error: lenght. Should be length.

gil davis
07-07-2003, 07:46 AM
Originally posted by vitorpt
var n=document.frm.cnome.lenght;should be var n=document.frm.cnome.length;