# Add validation to the phone number field in a contact form

**URL:** <https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425>\
**Category:** Feature Requests & Ideas\
**Created:** [June 26, 2022, 4:53pm UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425 "2022-06-26T16:53:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![almayor](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@almayor](https://community.surveysparrow.com/u/almayor)\
**Post date:** [June 26, 2022, 4:53pm UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425/1 "2022-06-26T16:53:44Z")

</div>

It currently shows an error, if there are brackets or dashes present in the input, such as +1 (234) 567-89-00. In many countries, grouping digits with braces and dashes is the way most people enter their phone numbers. It’d also be nice to specify the minimum number of digits that can be accepted as a valid phone number.

---

<div class="post-metadata">

**Author:** ![Wahab](https://dub1.discourse-cdn.com/flex013/user_avatar/community.surveysparrow.com/wahab/32/319_2.png) [@Wahab](https://community.surveysparrow.com/u/Wahab)\
**Post date:** [June 27, 2022, 6:33am UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425/2 "2022-06-27T06:33:18Z")

</div>

Hey Almayor 😀,

Welcome to SurveySparrow Community 💎

Thank you for sharing your feedback on the Phone number Question type. We agree that this is something we should come up with. Let me share this with my product team and come up with a solution.

As a workaround, you may use the **Contact Form** question type and use the phone number field which supports braces and dashes.

 ![Contact Form - Question Type](https://europe1.discourse-cdn.com/flex013/uploads/surveysparrow1/original/1X/0fca18248dd175a1d6c4f689e73638afda83e928.png)

 ![Live View](https://europe1.discourse-cdn.com/flex013/uploads/surveysparrow1/original/1X/0b6cdab251f3762392169fdb4e75bc86974a7b28.jpeg)

More details on this [link](https://help.surveysparrow.com/how-to-create-a-contact-form).

Hope this helps.  
👋🏽

---

<div class="post-metadata">

**Author:** ![almayor](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@almayor](https://community.surveysparrow.com/u/almayor)\
**Post date:** [June 27, 2022, 9:14am UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425/3 "2022-06-27T09:14:56Z")

</div>

Hey Wahab! Thank you for a response! It does indeed work as a workaround, although it accepts any type of text too.

---

<div class="post-metadata">

**Author:** ![Wahab](https://dub1.discourse-cdn.com/flex013/user_avatar/community.surveysparrow.com/wahab/32/319_2.png) [@Wahab](https://community.surveysparrow.com/u/Wahab)\
**Post date:** [June 27, 2022, 10:10am UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425/4 "2022-06-27T10:10:14Z")

</div>

Hey almayor,

You can change the data type from _ **text to number** _ by customizing the phone number field.  
Click on the three-dot and choose customize option

 ![Customize](https://europe1.discourse-cdn.com/flex013/uploads/surveysparrow1/original/1X/141731195e0b2517673ce5b5865240d30c2a4f9b.png)

where you can change the data type to _ **Number** _ and save the details.

 ![CustomizeField](https://europe1.discourse-cdn.com/flex013/uploads/surveysparrow1/original/1X/6b23c148166f278aabef42a92f4917213d96bc58.png)

**Note:** 🪶  
Additionally, you can

```
    1. Add a new custom field by clicking Add New Field button or the '+' sign.
    2. Customize Field will allow you to 
           a. change data type (Text, Number, Email, Date, and Dropdown) 
           b. change the label name of the field
           c. choose whether the field is mandatory or not. 

```

Hope this helps.  
👋🏽

---

<div class="post-metadata">

**Author:** ![almayor](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@almayor](https://community.surveysparrow.com/u/almayor)\
**Post date:** [June 27, 2022, 10:22am UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425/5 "2022-06-27T10:22:03Z")

</div>

Yes, but if I change the data type to number, dashes and braces are no longer accepted

---

<div class="post-metadata">

**Author:** ![Wahab](https://dub1.discourse-cdn.com/flex013/user_avatar/community.surveysparrow.com/wahab/32/319_2.png) [@Wahab](https://community.surveysparrow.com/u/Wahab)\
**Post date:** [June 27, 2022, 10:32am UTC](https://community.surveysparrow.com/t/add-validation-to-the-phone-number-field-in-a-contact-form/2425/6 "2022-06-27T10:32:39Z")

</div>

Oops i missed this. Let me share this with my team and share the update here.
