473,395 Members | 1,442 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,395 software developers and data experts.

Validating TextBox for accepting character only

hi dear

i am having a textbox in which a user must prvoide the three character long code. how to make validation for this textbox to accept only letter between a-z and A-Z. i am working in asp.net using c# and i need to do this using javascript.

please provide your support.

regards
vishal sharma
Sep 26 '06 #1
2 9302
r035198x
13,262 8TB
hi dear

i am having a textbox in which a user must prvoide the three character long code. how to make validation for this textbox to accept only letter between a-z and A-Z. i am working in asp.net using c# and i need to do this using javascript.

please provide your support.

regards
vishal sharma
And again I have to write,
Use regular expressions
Sep 26 '06 #2
ronverdonk
4,258 Expert 4TB
You can do this in JS in2 ways:

1. check wile you are typing. In this case each keypress is checked for the character typed and that the length of the field is not exceeded.

2. check AFTER the field has been filled in and it is checked for content and length.

You can always define your html <input> statement with a MAXLENGTH="3" attribute of course.

Ronald :cool:
Sep 26 '06 #3

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

Similar topics

0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
5
by: ameen.abdullah | last post by:
Hi Guys, I have a textbox in windows form that should only accept alphabets, numbers, spaces and underscore. If the textbox contains anyother character it should display a msg at the time of...
3
by: TheSteph | last post by:
Hi Experts ! I have a Winform Program in C# / .NET 2.0 I would like to ensure that a value in a TextBox is a valid Int32 when user get out of it (TextBox loose focus)
1
by: bhappy | last post by:
Hai, I want to validate a textbox in clientside and im using the following code. Regular Expression Validator Exp: " .{250}.* " --> It means minimum length of textbox should be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.