Is there any ready-to-use input element for phone number ? Preferrably with a dropdown to select the country.
Hi @nikobarli
I believe you can do this using Velo
https://www.wix.com/velo/forum/coding-with-velo/make-a-user-input-phone-number-display-as-xxx-xxx-xxxx-on-entry
Thank you. So there is no ready-to-use input element from EditorX, right ?
Hhmhh, Ok, I must use Velo then …
@nikobarli I did some digging and found out that you can also use Regex.
Regex (Regular Expression) is a series of numbers, characters and letters that ensure your visitors’ phone numbers save in the format you want.
How to use Regex:
-
Find or create the relevant Regex code for the phone number field in your form.
-
Add the Regex code in the Phone Number Format textbox.
Examples of Regex Codes:
Regex codes can be created however you want them, as long as they match the specific region’s rules. You can search online for a specific code for the desired area. A few examples are also below.
USA:
Regex Code: [1]\d{2}\d{3}\d{4}$
Description: This expression matches a hyphen separated US phone number, of the form ANN-NNN-NNNN, where A is between 2 and 9 and N is between 0 and 9.
Examples of matches: 800-555-5555 / 212-666-1234
Examples of non-matches: 000-000-0000 / 123-456-7890
If you don’t want to use the Advanced (Regex) number format, you can choose from the following options:
-
Default: Your visitors can only enter phone numbers that include digits and parentheses.
-
Unformatted: Your visitors can enter any phone number they want.
-
Custom: Create a custom format for your visitors to follow. For example, you can use “#” to indicate numbers and “-” to indicate spaces.
2-9 ↩︎