• Check out world news on HeadLinesList.com
  • Forum registration is now open for public.
Hello There, Guest! Login


Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where and how do I input a isnan statement into JavaScript?
#
I've been set a task to change a field so that the user can only enter 4 digits, I know I have to enter isnan statement please help

Ads

#
<input type="textbox" id="tbox" maxlength="4">

This is a textbox that can only have 4 digits.

To use the isNaN function, you will need to create an if statement like this:

if(isNaN(tbox.value) === true)
{
alert('Not a number.');
return;
}


At least I think this is what you're asking. Write a little more next time.

-Zachary

Ads

  


Forum Jump:


1 Guest(s)