Phone numbers

Don

Asked on November 3, 2022 1:33 PM

I am based in Hong Kong and phone numbers here are 8 digits. Since none of the available options are 8 digits on your validation list, I was wondering if you can add a validation for 8 digits.

Currently, I can only add a box for “Short Answer” for the phone number.

Would be great help if you could do it.

Thank you.

Simina D

Answered on November 3, 2022 7:11 PM

123FormBuilder Support
Hello Don,
 
Thank you for contacting us.
 
We cannot add new validations to the Phone field at the moment, but you can use the Regular Expression option in order to add the needed validation. 
 
  1. Add a Short Answer field and select “regular expression” as Data Format.
  2. Enter the following regex code: /^(\+\d{1,4}\s)?\(?\d{4}\)?\d{4}$/ 

 
By doing so, your users will need to enter 8 digits.
 
Here is a screenshot to guide you: 
 

Please let me know if you require any more information, I will be more than happy o help.

Don

Answered on November 4, 2022 7:55 AM

Dear Simina,

 

Many thanks for the detailed instructions, which worked well. One minor issue is that when entering the numbers it appears it must be 4 numbers then “space” then 4 numbers again, so if I entered 8 numbers it won’t work. Is it possible to
change it to just 8 numbers or that it will accept both options? If not I’d prefer just 8 numbers.

 

Thank you and sorry for the inconvenience.

Best regards,

Don

 

Permanently deleted u

Answered on November 4, 2022 2:47 PM

123FormBuilder Support
Hello Don,
 
I am glad to hear the workaround works for you.
 
Unfortunately, it is not possible to use both options.
 
Please use the following regex code for 8 digits without space: /^(\+\d{1,4}\s)?\(?\d{4}\)?\d{4}$/
 
Have a wonderful day!

Simina-Anita
Account manager
The 123FormBuilder Team