Click here to Skip to main content
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 21: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 Peter Leow 265
1 Mika Wendelius 235
2 CHill60 200
3 TheRealSteveJudge 150
4 Rob Philpott 130
0 Sergey Alexandrovich Kryukov 8,613
1 OriginalGriff 6,581
2 Peter Leow 3,962
3 Zoltán Zörgő 3,480
4 Richard MacCutchan 2,502

Advertise | Privacy | Mobile
Web02 | 2.8.150123.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