Add bootstrap tooltip in input field

104 views Asked by At

I'm using Bootstrap 4 on my website. Need to add tooltips for some elements. It's not so difficult, but I have problems with tooltips fir input fields.

This is example for one input field HTML Code:

<div class="col">
   <div class="field_item is-label-hide">
      <input data-toggle="tooltip" data-placement="top" name="<?php echo $form->getName(); ?>[newprize][0][title]" id="prizeTitle" title="Название должно интриговать, но соответствовать тому, что вы разыгрываете." type="text" value="" valid-field="1" placeholder="Название приза"/>
      <label>Название приза</label>
    </div>
</div>

This is jQuery:

jQuery(document).ready(function ($) {
        $("#prizeTitle").tooltip({
            trigger:'focus', 
            title: 'Название должно интриговать, но соответствовать тому, что вы разыгрываете.'
        });
    });

My website use Joomla 3. But all tooltips works, but in input doesn't work. Any suggestions? Thanks!

0

There are 0 answers