Possible Duplicate:
How do I ensure a text box is alphanumeric but without a leading digit?
in my application i have textbox in that user can’t enter digit is there any solution for this thank u
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
there are many ways to tackle your problem
1)you can assign a validator to a textbox and use the numeric only validator.
2)you can fire your own function in textchanged and capture the text either by using a regular expression or by manually checking if the string contains a nubmer or not.
3)You can try this, make a javscript function
and in the markup of your aspx page have the textbox refer to the function like this
Hope this helps.
========UPDATED code to make it accept first letter as character and rest as alphanumeric=======
Since you want to enforce only alphabets in first character so you need to check only for the first character, as you are allowing alphanumerics on all other positions then you don’t need to check them. (it will allow symbols too in alphanumerics).
i believe you are doing this for passwords check, it will be much neater if you assign a regular expression validator, which causes a regular expression validation to occur when the password box loses it’s focus.