Skip to content

Latest commit

 

History

History

CheckPhoneNumberControl

README.md

Check Phone Number Control

Purpose

A Control that checks if the given string is a correct phone number. You can chonfigure which country codes should be accepted. The Source you can download here is translated in English, Swedish and German.

Download

You can download the last release here.

Example

Configuration CorrectSSSN IncorrectSSSN

Configuration

Configuration Description Required
Number Valid Related true/false field that indicates whether the entered number is valid. Can be used to prevent saving the form if not valid
Format The Format the phone number should be transformed to. International (+46 70 712 34 56), National (070-712 34 56) or E164 (+46707123456) X
Default CC The Default country code.
Allowed CC Comma separated list of allowed country codes.
Excluded CC Comma separated list of excluded country codes.
Allowed Type Comma separated list of allowed number types.
Excluded Type Comma separated list of excluded number types.
Show Button Yes or No field. Defines whether a button should be shown.
Click to Call Type DropDown with different choices of types that should be used when the button is clicked.
Custom Click to Call Type Yes or No field. Defines whether a button should be shown.
Open Quick Create Yes or No field. Defines whether the button should open the "Quick create" form. Does only work in MDAs.

Possible Country Codes

ISO 3166 (alpha 2) country codes needs to be used. You can find a list of possible values here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes

Possible Types

You can find a list of possible values here: https://www.npmjs.com/package/awesome-phonenumber#phone-number-types

Improvements/New Functions

  • Optimize the check of swedish numbers.
  • Add possibility to exclude country codes.
  • Add default country code.
  • Choose Format between International, National or E164.
  • Add possibility to only allow certain phone number types. For example: Mobile or fixed line.
  • Show indicator besides Inputfield.

Used Libraries