function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
if (phone != null) { Pattern phonePattern = Pattern.compile('\\D*?(\\d\\D*?){10}'); Pattern numericPattern = Pattern.compile('[0-9]{10}'); Matcher phoneMatcher = phonePattern.matcher(phone); if(phone.length() == 10) { Matcher numericMatcher = numericPattern.matcher(phone); if(!numericMatcher.matches()) ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Invalid Phone Number')); else ApexPages.addMessage(new ApexPages.message(ApexPages.severity.CONFIRM,'Your phone number is valid: '+phone)); } else ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Invalid Phone Number')); }
Hope it helps..
If yes select this as best answer...Thank u