Grammar rules

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2007
Posts: 113
Reputation: abhi_elementx is an unknown quantity at this point 
Solved Threads: 6
abhi_elementx's Avatar
abhi_elementx abhi_elementx is offline Offline
Junior Poster

Grammar rules

 
0
  #1
Mar 29th, 2009
Hi folks, I want to write grammar rules for a form entry application.
On the form/frame I have some fields:
Customer name, telephone number
I check the validity of the textfileds before data saved.
What can be the grammar for a telephone number and name considering that users shud not enter spaces, wild chars, alphanumeric chars, etc...
Thanks.
PEACE !
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,821
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Grammar rules

 
0
  #2
Mar 29th, 2009
Originally Posted by abhi_elementx View Post
What can be the grammar for a telephone number and name considering that users shud not enter spaces, wild chars, alphanumeric chars, etc...
How can you enter a phone number without using alphanumeric characters (i.e. digits)?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 113
Reputation: abhi_elementx is an unknown quantity at this point 
Solved Threads: 6
abhi_elementx's Avatar
abhi_elementx abhi_elementx is offline Offline
Junior Poster

Re: Grammar rules

 
0
  #3
Mar 30th, 2009
See, alphanumeric means alphabets and numbers.
So a user can enter 987r65436u by mistake.
PEACE !
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 794
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Master Poster

Re: Grammar rules

 
0
  #4
Mar 30th, 2009
I think for this purpose you will want to use regular expressions.

Check out the API for the java.util.regex package.
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC