Example 1 - International phone with country dropdown list and live validation (formvalidation plugin)
$form = new Form('plugins-intl-tel-input-form-1', 'horizontal');
$form->addInput('text', 'user-phone-1', '', '', 'data-intphone=true, data-fv-intphonenumber=true, required');
// jQuery validation
$form->addPlugin('formvalidation', '#intl-tel-input-form-1');
<div class="row mb-3">
<div class="col-sm-offset-4 col-sm-8">
<input id="user-phone-1" name="user-phone-1" type="text" value="" data-intphone="true" data-fv-intphonenumber="true" required class="form-control">
</div>
</div>
Example 2 - International phone with country dropdown list
$form = new Form('plugins-intl-tel-input-form-2', 'horizontal');
$form->addInput('text', 'user-phone-2', '', 'Phone:', 'data-intphone=true, required');
<div class="row mb-3">
<label for="user-phone-2" class="col-sm-4 col-form-label">
Phone: <sup class="text-danger">* </sup>
</label>
<div class="col-sm-8">
<input id="user-phone-2" name="user-phone-2" type="text" value="" data-intphone="true" required class="form-control">
</div>
</div>
Example 3 - International phone with fixed single country (no dropdown list)
$form = new Form('plugins-intl-tel-input-form-3', 'horizontal');
$form->addInput('text', 'user-phone-3', '', '', 'data-intphone=true, data-allow-dropdown=false, required');
<div class="row mb-3">
<div class="col-sm-offset-4 col-sm-8">
<input id="user-phone-3" name="user-phone-3" type="text" value="" data-intphone="true" data-allow-dropdown="false" required class="form-control">
</div>
</div>
Example 4 - International phone with specific country list
$form = new Form('plugins-intl-tel-input-form-4', 'horizontal');
$form->addInput('text', 'user-phone-4', '', '', 'data-intphone=true, data-only-countries=pt\,es\,fr\,it, required');
<div class="row mb-3">
<div class="col-sm-offset-4 col-sm-8">
<input id="user-phone-4" name="user-phone-4" type="text" value="" data-intphone="true" data-only-countries="pt,es,fr,it" required class="form-control">
</div>
</div>