Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want a TextBox to allow only alphabets to be entered . If a number is entered it shouldn't be accepted and not displayed in the textbox. Please guide me on how to do it.
I am using Microsoft Visual Web Developer 2010 Express.
Posted

You can use javascript to limit inputs to characters only, refer below links
how to validate textbox to accept only characters[^]
How to make keypress event of asp textbox?[^]
as an alternative approach if your project already using ajax control toolkit, try
Ajax Control Toolkit FilteredTextBox[^]
 
Share this answer
 
Comments
Malayali Coder 10-Nov-14 1:34am    
Thanks i used the ajax control toolkit.
Also i tried the other solutions too that you mentioned. but i couldn't use the onkeypress event in the textbox. could it be because of an older version i am running.
I only have OntextChanged event that can be used in my textbox.
 
Share this answer
 
Comments
Malayali Coder 8-Nov-14 1:17am    
how do i link a javascript function to textbox events.
Thanks7872 8-Nov-14 1:19am    
Learn it using Google. You have to make some effort from your side also.
Malayali Coder 8-Nov-14 1:28am    
ok.thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900