yii2-phone-input
yii2-phone-input copied to clipboard
how to set 'id' value for the phone input ?
I tried lot of things to set id attribute for phone input HTML tag but none of them work
<?= $form->field($parent, 'primary_phone', ['options' => ['class' => 'col-md-4'], 'selectors' => ['input' => '#parent1-primary-phone']])
->widget(PhoneInput::className(['id' => 'test']), [
'jsOptions' => [
'allowExtensions' => true,
'preferredCountries' => ['ca', 'lb'],
'nationalMode' => false
],
'defaultOptions' => [
'class' => 'form-control1',
'id' => 'test'
]
]); ?>
Did I miss something ?
@michaelnguyen547 try like this
$parent, 'primary_phone', ['options' => ['class' => 'col-md-4', 'id' => 'myID']