Numbers or letters in a TextBox

L

Lucas Tam

How I can have a TextBox that to only lets me enter
letters or numbers?


You'll need to use Client side javascript.

Or, you can put a custom validator on the server side and check the input.
 
J

Jerry III

You should always have a server side validator, just in case some of your
users don't support JavaScript (or they turned it off). And remember,
postbacks do not have to come from your page, it's so simple to fake a form
submission with made up values. The moral is never trust anything that comes
from the client, no matter how much validating JavaScript you have there.

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top