function isposint(field){ inputstr = field.toString() for (var i = 0; i < inputstr.length; i++) { var onechar = inputstr.charAt(i) if (onechar < "0" || onechar > "9") { return false } } return true }