Click here to Skip to main content
Rate this: bad
good
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).
(+91).(80).(4465444)..
 
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,
 
Siva
Posted 4-Dec-12 21:55pm

1 solution

Rate this: bad
good
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!?
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 5 Dec 2012
Copyright © CodeProject, 1999-2014
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