webcito/bs-phone-input

description

dev-main 2024-03-13 11:28 UTC

This package is auto-updated.

Last update: 2025-01-13 13:22:02 UTC


README

This plugin creates an input group preceded by a dropdown of all countries.

Installation

manual

Download and include the script at the end of the body tag.

<!--suppress HtmlUnknownTarget -->
<script src="path/to/jquery.bsPhone.min.js" type="text/javascript">

composer

via command

composer require webcito/bs-phone-input:dev-main

via composer.json

{
  "require": {
    "webcito/bs-phone-input": "dev-main"
  }
}

Usage

All inputs with the attribute [data-bs-toggle="phone"] are initialized automatically.

<input type="tel" value="+49123456789" data-bs-toggle="phone" id="example">

<!-- load jQuery and Bootstrap before -->
<script src="dist/jquery.bsPhone.min.js" type="text/javascript">
<script>
    $('#example').bsPhone();
</script>

Options

Methods

Methods are called as follows

$('input').bsPhone('method', param);