Skip navigation |

Phone numbers

To check that someone is only adding valid characters to the Phone Number field on your form, follow these steps.

Last updated: 18 December 2009, 16:43

You may wish to add validation to your form to ensure that your users have typed in their phone number in a valid format.

To validate that the number is in a valid format, you can use the Single Line Text input type and add the following to the Parameters box:

(\+?[0-9]{2} ?)?\(?[0-9]*\)?[0-9 ]*

This allows the user to type:

An optional +
An optional opening bracket
Some numbers
An optional closing bracket
Some more (optional) numbers
Spaces in between these

This will allow the user to type phone numbers in the following formats:

+44 (0) 113 250 7799
+44 01132507799
(0113) 2507799
0113 2507799
01132507799

If you just want to validate that the user has only typed numbers into the box, along with spaces, brackets and the + sign (in any order and quantity), you can add the following to the Parameters box:

[0-9() +]*