In my HTML page, I have a Javascript portion that tells the user to enter his nickname because he has been accepted for a high score (it's a game ). I used the prompt command as follows:
tempname = prompt("You finished with a score of " + score + ".\nPlease enter your nickname for the Hall of Fame.", "Anonymous")
Now I only want the user to enter letters (no numbers, spaces or symbols)
Is there a function like: tempname.isAlpha() to see if the
users has entered only letters? If not, what can I do to verify that the string stored in "tempname" is composed of letters only?
is it something like if ( tempname > 'a' && tempname < 'z') ??
tempname = prompt("You finished with a score of " + score + ".\nPlease enter your nickname for the Hall of Fame.", "Anonymous")
Now I only want the user to enter letters (no numbers, spaces or symbols)
Is there a function like: tempname.isAlpha() to see if the
users has entered only letters? If not, what can I do to verify that the string stored in "tempname" is composed of letters only?
is it something like if ( tempname > 'a' && tempname < 'z') ??