1. check one character at a time in the string, and see it it in [0123456789];

2. use Regular Expressions (the RegExp would be [^0-9]), which, BTW, works with JS1.2 (NN4.x IE4.x).

BUT, if you instead think of it as a number with a length constraint, here is a very simple method to do the trick - i bet you'll like it :)

--//--

function checkSocialNum(aField) {

if(aField.value == "") self.alert("Please, enter Social Number"); // it's empty

else {

var val = parseInt(aField.value, 10); // let's make it a number

/* it must:

* 1. be a valid number (i.e. !isNaN)

* 2. be positive, integral, and 9 in length (i.e. > 99,999,999 )

*/

if(!isNaN(val) && val > 99999999) return true // it's valid

self.alert("Invalid Social Number"); // it's not empty & not valid

}

// empty & invalid input "clean-up"

aField.focus();

aField.select();

return false;

}

--//--