yii2-phone-input icon indicating copy to clipboard operation
yii2-phone-input copied to clipboard

how to set 'id' value for the phone input ?

Open michaelnguyen2021 opened this issue 7 years ago • 1 comments

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 ?

michaelnguyen2021 avatar May 03 '17 17:05 michaelnguyen2021

@michaelnguyen547 try like this

$parent, 'primary_phone', ['options' => ['class' => 'col-md-4', 'id' => 'myID']

Borales avatar Jun 10 '17 16:06 Borales