This plugin for jQuery which is allow to select fitted mask of input automatically using the prefix of phone number.
The sample of using
Type any phone number to the following input field:
The label of checkbox is changing according the typed phone number. If the checkbox is unmarked only digits are allowed to type.