473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

TextboxFiltering

How to enter only digits and only characters to textboxes

suppose at once i need to enter only digits at that time don't allow characters
and similarly for characters don't allow numerics
Jan 3 '08 #1
2 921
CyberSoftHari
487 Expert 256MB
For textboxes we have KeyPress, KeyDown and, KeyUp events try your validations here and enable disable the e.Handle.
Note: You have to post your front-end and read posting guidelines.
Jan 3 '08 #2
Frinavale
9,735 Expert Mod 8TB
How to enter only digits and only characters to textboxes

suppose at once i need to enter only digits at that time don't allow characters
and similarly for characters don't allow numerics
If this is a web application...please check out the article on How to check if a textbox contains a number. It gives an example of field validation in both server side code (this can be used in windows applications too), and client side code using JavaScript (although regex's work a bit more efficiently).

-Frinny
Jan 3 '08 #3

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.