[Javascript] how can I check to see if a text box has a numbe r or a string in it???

Scott.Wiseman swiseman at remax-cahi.com
Thu Jun 13 18:40:37 CDT 2002


Thanks Peter


alert(parseInt(parent.TransDetail.myform.ClosingMonth.value));
this gives me NaN


both of these are not working...

if( parseInt(parent.TransDetail.myform.ClosingMonth.value) == "NaN")
        {
            alert("You must select a Month");
        return false;
        }
================== or ======================
if( parseInt(parent.TransDetail.myform.ClosingMonth.value) == NaN)
        {
            alert("You must select a Month");
        return false;
        }

this is not working

what am I doing wrong?



More information about the Javascript mailing list