Jump to content

International phone number automatic formatting


aquiss

Recommended Posts

Can anyone else confirm that the new "international phone number automatic formatting" introduced into 7.4.0, even when disabled from within the new option, is still changing client profile contact numbers to start with the international format (in our case +44.)?

 

Link to comment
Share on other sites

3 hours ago, aquiss said:

Can anyone else confirm that the new "international phone number automatic formatting" introduced into 7.4.0, even when disabled from within the new option, is still changing client profile contact numbers to start with the international format (in our case +44.)?

 

yes - but if the feature is disabled, and you update a telephone number in the admin area, it stores the phone number exactly as you entered it into the database table (even though it will still show the +44 prefix in the profile);

if you update a phone number while the feature is enabled, it will add +44 (or whatever) to the phone number when updating the database table.

 

 

Link to comment
Share on other sites

1 minute ago, brian! said:

yes - but if the feature is disabled, and you update a telephone number in the admin area, it stores the phone number exactly as you entered it into the database table (even though it will still show the +44 prefix in the profile);

if you update a phone number while the feature is enabled, it will add +44 (or whatever) to the phone number when updating the database table.

 

 

Thanks for the confirmation of how it works, bit confusing, but at least I know.

Link to comment
Share on other sites

3 minutes ago, aquiss said:

Thanks for the confirmation of how it works, bit confusing, but at least I know.

yeah, at first reading, the documentation was confusing on this - it was only by changing a phone number in the admin area and spotting the changes in the database table, that I could figure out what the differences were. :roll:

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for hijacking the thread but any chance you can get the nice country code UI for a custom field? As we have an extra field for a mobile number. Unless WHMCS will add a mobile number option in the future I suppose. 

Edited by Bertie
Link to comment
Share on other sites

3 hours ago, Bertie said:

Sorry for hijacking the thread but any chance you can get the nice country code UI for a custom field? As we have an extra field for a mobile number. Unless WHMCS will add a mobile number option in the future I suppose. 

it looks like the jQuery code for this is in /templates/six/js/scripts.min.js - which you could edit in scripts.js and then minify it... how simple it would be to add/copy the functionality to a customfield, I don't know... it certainly looks doable.

if it helps, perhaps you might want to take a look at the jQuery source code used for this - WHMCS didn't write it themselves (which probably explains why it works and looks good lol)...

https://github.com/jackocnr/intl-tel-input

Quote

A jQuery plugin for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.

if you can't figure out how to duplicate the existing WHMCS code, i'd be tempted to just start from scratch and use the above plugin solely for your customfield...

I might be tempted to have a play with this at the weekend - though if you do it successfully sooner, do post the solution as it will allow me to spend time on other projects!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated