• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation of a textbox value in javascript

 
Yell Srik
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is the code i am using to validate the entries into a textbox:




In the above code, if any value other that 0 to 9 is entered, alert is thrown.

Now i want this code to be modified such that only 1 or 2 digit number should be valid ie if i enter 111 or 2345, it should throw the alert message.

How can i acheive this??


Thanks in advance
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check form.regno.value.length
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic