In my case, tooltip is coming when user place mouse on input control but I want to trigger tooltip. Means when validation will fail, then tooltip will be display below input control.
this is the code i am using to show tooltip. just tell me what to edit in this code.
var options = { html: true, placement: 'bottom', title: '<div class="tooltip-alert alert-danger" data-placement="bottom">' + message + '</div>' };
$(inputElement).addClass('validation-error');
inputElement.tooltip("destroy")
.addClass("error")
.tooltip(options);
thanks
Use this way:
$(element).tooltip("show");
So, when the validation error occurs, you need to use:
inputElement.tooltip("show");
After going through the comments, I feel you need a static tooltip to be displayed when there is an error.
Bootstrap tooltip trigger=manual is what you require.
Here is the fiddle for you : Fiddle
Edit Added Hide button to hide tooltip.
Fiddle# 2
Hope this helps.
-Help :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With