Question : Limit textbox to number of chars entered

I have 3 textboxes whre Phone number is entered.
first textbox - xxx (area code)
second textbox -xxx
third textbox - xxxx
First it should limit only the chars  entered and secondly
it should accept only [0-9]

Answer : Limit textbox to number of chars entered

Hi,

I have given code for asp.net only.

You have to manually type below line.
onKeyPress="return CheckNumericKeyInfo(event.keyCode, event.which);"

CheckNumericKeyInfo is a javascript function name. I have written that function in script tag. Whenever the key is pressed in textbox,  CheckNumericKeyInfo function will be called. I have given the sample test page code in my comment #33095932. Please go through it once again.
Random Solutions  
 
programming4us programming4us