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

How to validate letters and numbers

Hello all,

When I run the application, it requires to enter Employee number, social, and name. I can enter any letter and number to call employee number, social and name. I do not know how to validate letters and number.

For example, for the employee number, I have to enter number only;
for employee name, I have to enter letter only,

Please give some idea.
Thanks
Nov 12 '07 #1
1 2828
r035198x
13,262 8TB
Hello all,

When I run the application, it requires to enter Employee number, social, and name. I can enter any letter and number to call employee number, social and name. I do not know how to validate letters and number.

For example, for the employee number, I have to enter number only;
for employee name, I have to enter letter only,

Please give some idea.
Thanks
Better write a separate class for all the validations and put the validNumber, validString e.t.c methods in there.
For the validations itself you can use exception handling for numbers. Just open the specs for the Integer class and look at the parseInt method. An exception is thrown if the input is not a valid int. Also check out regular expressions.
Nov 12 '07 #2

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

Similar topics

2
by: deko | last post by:
I use variables in some links on my page. I need to send these variables so I can change the color of the links in the navbar when the user is on that page. If you click around on the site you...
7
by: Dragon | last post by:
Hi, I am trying to find out if there is a good (Built-in?) way to validate text input. I would like to check a textbox to see whether user enter a proper name (without numbers, symbols etc) or...
1
by: Simon Barnett | last post by:
Hi, RE: Converting pages including ASP pages for XHTML My question relates to ASP not ASP.NET - I can't find a newsgroup for ASP and hoped it was still relevant in ASP.NET - sorry if it's not....
1
by: Kosmos | last post by:
Since people have been so helpful on this site I thought I'd contribute what little I can...since I am not a programmer but I'm working on an access database for work Anyways I had to remove...
12
by: adzir | last post by:
Hi, I need to validate password keyed in by the system users so that the password will contain only letters and numbers plus at least one capital letter. Exclude these symbols , < ? / * ( ) &...
25
by: LeWaltz | last post by:
hi everyone, i am a newbie here, and i have a problem in my programming code... i wanted to make sure that i can only detect positive numbers, and not letters... examles: "abc", "ab100", "-100",...
1
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric...
7
vikas1111
by: vikas1111 | last post by:
Hi All I Want to validate password,, the condition is that first 2 letters must be numbers and remaining 4 must be alphabets..How can i solve this ????
5
by: ghjk | last post by:
I have a web site with several web pages. They are having different number of variables. eg: first page having 4 variables in the form(Name, Phone, ID, Gender) second page having 10 variables in the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.