Add validation to the phone number field in a contact form

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.

Hey Almayor :grinning:,

Welcome to SurveySparrow Community :gem:

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.

More details on this link.

Hope this helps.
:wave:t4:

1 Like

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

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

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

Note: :feather:
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.
:wave:t4:

1 Like

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

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

1 Like