Check if part of string is a number
Posted: Tue Oct 15, 2002 9:53 pm
I'm a newbie to javascipt.
When a user submits a form I want to check one of the characters with in a field to see if it is a number, just one character though, not the entire field. Heres what I do now, its sad I know. and I do this until I get to 9. There has to be a better way, please tell me what it is.
Thanks,
Ace
When a user submits a form I want to check one of the characters with in a field to see if it is a number, just one character though, not the entire field. Heres what I do now, its sad I know.
Code: Select all
if(checkStr.charAt(0) != 0 && checkStr.charAt(0) != 1...)Thanks,
Ace