Jump to content

Invalid Phone Format


SaneChoiceLtd

Recommended Posts

Dear All,

 

We are a UK based company and a few customers have found signing up a struggle in regards to the telephone numbers. (Please see attached image).

 

In essence, when they put in a standard UK number, it throws a format error. The customers then struggle to find a combination that works. (For example, most UK customers will want to insert 01255 555 555 but its not intuitive for them to insert 44.1255 555 555).

 

Any ideas on how to change this so its more free-text and flexible?

 

Thank you.

 

SCL

Invalid Phone.png

Link to comment
Share on other sites

take a look at your code and there's additional validation code that isn't present normally...

 

       <script type="text/javascript">
       //<![CDATA[
           jQuery(document).ready(function(){

               jQuery("input[name='phonenumber']").blur(function(){
                   if(!this.value.match(/^(\+?[0-9]{1,3})\.[0-9]+x?[0-9]*$/))
                   {
                       if(!jQuery("#msg").length)
                       {
                           jQuery("input[name='phonenumber']").after("<div id='msg'></div>");
                       }
                       jQuery("#msg").html("<span style='color:#DF0101'>Invalid Phone Number Format (ex. 1.4163334444)</span>");
                        jQuery(".btn-primary").prop("disabled", true);
                   }
                   else
                   {
                       jQuery("#msg").html("");
                       jQuery(".btn-primary").prop("disabled", false);
                   }
               })

it seems to be present in whichever template you specify - so I assume it's being added by a hook (possibly OpenSRS Pro ?) - anyway, it's creating the error message, not a WHMCS file.

Link to comment
Share on other sites

Thank you Brian - Much appreciated. I think you have identified the exact issue.

 

We do use OpenSRS PRO and it may be forcing this validation to ensure that domains can be registered successfully. This means that UK registration sign-up (even when no domain are involved) is also affected.

 

The problem now is that changing these rules will affect domain sign-ip with OpenSRS.

 

Anyone with any tips or experience with this dichotomy then please do let me know!

Link to comment
Share on other sites

if it's only/mainly a UK user issue, then perhaps modify the error message in /includes/phonecheck.php (not encrypted) and make it more uk centric...

 

Invalid Phone Number Format - if in UK, use (44.1234567890)

and perhaps drop an email to OpenSRS support to see if there's any way to improve this in future versions... if you weren't using the Pro module, WHMCS adds the country code to the phone number based on the clients country (with registrations) and so does the work for you,

 

https://forum.whmcs.com/showthread.php?91718-Whmcs-and-phonenumber-in-ORG-contact-(countrycode-not-prefilled-)&p=386202#post386202

 

but as you can, you can't really remove it because while it might make the form easier, it might also prevent successful registrations. :roll:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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