About phone input

This jQuery plugin allows you to add a phone input to easily format phone numbers in your Bootstrap form. This phone input can be used along with our country picker jQuery plugin.

Examples

Simple example for formatting a phone number in input text

<input type="text" class="form-control bfh-phone" data-format="+1 (ddd) ddd-dddd">

Example for formatting a phone number in input text with a predefined number

<input type="text" class="form-control bfh-phone" value="5555555555" data-format="+1 (ddd) ddd-dddd">

Example for formatting a phone number based on a country

<input type="text" class="form-control bfh-phone" data-country="US">

Example for formatting a phone number based on a country picker



<select id="countries_phone1" class="form-control bfh-countries" data-country="US"></select>
<br><br>
<input type="text" class="form-control bfh-phone" data-country="countries_phone1">

Simple example for displaying a formatted phone number

<span class="bfh-phone" data-format="+1 (ddd) ddd-dddd" data-number="15555555555"></span>

Available languages

Not applicable.

Options

Option Description
country Two letters country code or ID of a bfh-countries HTML element. To filter based on a country. Required. Default: ''
number Integer. Phone number to display. Default: ''
format String. Format of the phone number. Use "d" for digits in the format. Default: true

Methods

None.

Events

None.