Click here to Skip to main content
11,714,776 members (79,469 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Java JSF
Dear All,

I am developing an application using prime faces where i use contact form in that which consists of mobile and telephone numbers..

Here the sample for telephone are as follows:
(country-code).(state-code)(telephone number).

Where in India country code is same , but state code differs form each..can any one help in validating a number for state code in telephone field..

Example state-codes,080,04545,0452
Awaiting a reply..

Thanks in advance,

Posted 4-Dec-12 20:55pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You already said it - validation is the key.
You need to check the entered value before you use/store it.
If the value is a valid number it's ok. Otherwise react.

State codes are fixed values. They don't change. So it's pretty simple to compare them.
Comparing a number should not be a big deal!?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 570
1 Richard MacCutchan 275
2 Maciej Los 274
3 OriginalGriff 140
4 CHill60 135
0 Sergey Alexandrovich Kryukov 545
1 CHill60 375
2 Maciej Los 324
3 Richard MacCutchan 310
4 OriginalGriff 260

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 5 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100