Twitter Bootstrap with ActveForm field

i am trying to use tooltip function in yii2 form field i tried looking online but form->field() doesnt have any propert of data-toogle title rel => ‘title’ i can use bootstrap tooltip on the html form on same page but i want to use it on form input field

Let me know if i am missing any property here

Here is the code of my view file I tried hint as well but thats not it

thank you




<?php $form = ActiveForm::begin(['options'=>['enctype'=>'multipart/form-data']]); ?>


        <?= $form->field($model, 'username')->hint('testing') ?>


        <?= $form->field($model, 'password')->passwordInput() ?>


        <?= $form->field($model, 'password_repeat')->passwordInput() ?>


        <?= $form->field($model, 'email') ?>


        <?php ActiveForm::end(); ?>




Hi, Montu

Yii2 doesn’t have any tooltips. You should specify it by yourself.

Here is a working example:





// JS


$(function () {

  $('[data-toggle="tooltip"]').tooltip()

})


OR


$('[data-toggle="tooltip"]').tooltip({

    placement: "right",

    trigger: "focus"

});




// VIEW


<?= $form->field($model, 'title')->textInput([

    'title' => 'Tooltip content',

    'data-toggle' => 'tooltip',

    'data-trigger' => 'focus',

    'data-placement' => 'bottom'

]) ?>




@Motion Thankyou very much for your replay

and that was the perfect answer i was looking for

its working fine now

thank you for your help