>having to check explictly for al the cases with an endless if. I've
>tried with character>='A' and also with the Ascii code but I had no
>success.
hmmm, this should work.
function isalpha(c) {
return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}
function isdigit(c) {
return ((c >= '0') && (c <= '9'));
}
function isalnum(c) {
return (isalpha(c) || isdigit(c));
}
bye
--
thomas....@fernuni-hagen.de -+- http://www.come.to/salvador aka
http://www.stud.fernuni-hagen.de/q4307909/welcome.htm
Here's some funky-looking functions that'll also work:
var alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var digits = "0123456789";
function isAlpha(c) {
return (alphas.indexOf(c) != -1);
}
function isDigit(c) {
return (digits.indexOf(c) != -1);
}
function isAlphaNum(c) {
return (isAlpha(c) || isDigit(c));
}
--
========================================================================
Thogek
tho...@alumni.caltech.edu
http://www.alumni.caltech.edu/~thogek