Have a look at http://www.castleriggmanor.co.uk/leaderboard.html
The boxes at the top move the different groups up the screen, but the
problem is that if you enter a letter rather than a number in the right hand
box (the left hand box is for the group letter ie 'a') then the whole thing
stops and crashes...
What is the javascript code to reject numbers rather than letters when the
function is called...
Here is how I works
The function doitnow() puts a number in text fields of a hidden form. The
function slowstuff() then reads these boxes every 2 seconds and moves the
groups up the screen as appropriate.
BUT HOW DO I MAKE SURE THAT IF A LETTER IS ENTERED INTO THIS TEXT FIELD BY
ACCIDENT THEN THE WHOLE THINGS DOESN'T GO WRONG???
Thanks in advance for any help and advice
Jack Regan
Although this question is certainly on topic for this group, this group does
not get much traffic. You will probably get quicker help by posting to
microsoft.public.scripting.jscript.
> Have a look at http://www.castleriggmanor.co.uk/leaderboard.html
I don't see the need to do that. Unscrupulous people have been known to
trick people into loading their malicious websites by posting questions
containing links to the websites in newsgroups. You explanation as follows
is sufficient.
>
> The boxes at the top move the different groups up the screen, but the
> problem is that if you enter a letter rather than a number in the
> right hand box (the left hand box is for the group letter ie 'a')
> then the whole thing stops and crashes...
>
> What is the javascript code to reject numbers rather than letters
> when the function is called...
>
>
Use the isNaN function
if (isNaN(entry))
alert("it's not a number")
else
alert("it's a number")
The WSH documentation, which contains the jscript reference can be
downloaded from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en.
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.