function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RockersRockers 

How to customize the phone number format?

Hi Friends,

 

               I developed one Visual force page for Contact Us. In that page, fields are provided for capturing the person details like name, company, query type, suggestion and contact number.

 

           For contact number, we used Phone Datatype for it. But, the  thing is that it accepts the characters also. We wrote the validations for this not accepting if characters found in contact numbe value.

 

           Now, we want to change the format contact number as following: country code+statecode+remaining phone number.

 

For ex:-

Contact Number : +91(44)-4200 4287 / +91 9962847510

 

          Like this, we need to customize the format. Is there any other way to accepting contact number format. Otherwise, we need to write the validations in controller for accepting this format.

 

          Please give me any suggestions to solve this.

 

Regards,

Phanikumar

kiranmutturukiranmutturu

u can change the format in the back end by using patter and matcher object in apex....how ever they are entering collect the field data and use ur patter and insert in to database.

 

other wise give an onblur validation error format help text besides that text box...