close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Customising Phone number format for other Countries

Thread began 12/21/2009 5:19 pm by jebrandon343719 | Last modified 2/09/2010 10:32 am by Jimmy Wu | 4308 views | 9 replies |

jebrandon343719

Customising Phone number format for other Countries

Hi, How do I change the format for the phone number - in the user's profile page?
At the moment it reformats a phone number to (000) 000-0000. I want to impliment an Australian format - (00) 0000-0000. How do I achieve this?

Sign in to reply to this post

Jimmy Wu

The 10 digit format is already supported. To get the format to store in the (xx)xxxx-xxxx format in your database, you will have to find the phone number input box and find where it has this:
'x (xxx) xxx-xxxx'

and change it to this:
'x (xx) xxxx-xxxx'

Sign in to reply to this post

jebrandon343719

Thanks

Thanks - that was easy - cannot believe I didnt see it.

Sign in to reply to this post

Jimmy Wu

No worries, everyone misses things like that at some time. If you run into any additional issues, feel free to open a new thread.

Sign in to reply to this post

cj.tung395641

Originally Said By: Jimmy Wu
  The 10 digit format is already supported. To get the format to store in the (xx)xxxx-xxxx format in your database, you will have to find the phone number input box and find where it has this:
'x (xxx) xxx-xxxx'

and change it to this:
'x (xx) xxxx-xxxx'  


Hi Jimmy,
I have changed 'x (xxxx) xxxx-xxxx' in Admin orders_Update.php, but somehow it was failed to update when I tried on my website.

The phone box is green, but when I pressed update button it shows "Please enter a phone number to call with shipping quesions"

Thank you.

Sign in to reply to this post

Jimmy Wu

Are the valid lengths on that number format 8, 12 and 13? And if its 13, is there a certain value that the first digit has to be?

Above I said the 10 digit format is already supported. Your format seems to be longer, so you get an error.

Sign in to reply to this post

cj.tung395641

In Germany the phone number usually is 12 digit and looks like this (XXXX)-XXXX-XXXX.
Can I do anything about it? Thank you

Sign in to reply to this post

Jimmy Wu

First thing to do would be to change the format to that, and remove the extra 'x' at the beginning:
'(xxxx) xxxx-xxxx'

Next you will have to go to the top of the page and find this code:

php:
$WAFV_Errors .= WAValidatePN(((isset($_POST["OrderPhone"]))?$_POST["OrderPhone"]:"") . "",true,false,true,8);



Change the false to a true.

Then go to the WA_ValidationToolkit directory and open the WAVT_Scripts_PHP.php file and find the function:
function WAValidatePN($value,$areaCode,$international,$required,$number) {

In this function you will want to find this block of code:

php:
if ($international)  {

      if  (strlen($newVal) < 5)  {
        $isValid = false;
      }
    }



Change the condition:
strlen($newVal) < 5

to look like this:
strlen($newVal) != 12

Sign in to reply to this post

cj.tung395641

Thank you Jimmy, everything works well!

Sign in to reply to this post

Jimmy Wu

Great to hear it. If you run into any additional issues, feel free to open a new thread.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...