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.

Recommended Answers

All 3 Replies

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)?

See, alphanumeric means alphabets and numbers.
So a user can enter 987r65436u by mistake.

I think for this purpose you will want to use regular expressions.

Check out the API for the java.util.regex package.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.