I've been looking everywhere, is there any way to force show the tooltip, not using an event, but using a js code, because we all know the flaw of numerical input and the paste exploit.
<script type="text/javascript">
var previous;
//Buy Button JS code
$(function () {
$("#searchform").bind('submit', function () {
var str = $('#search-form').val();
if (str.match(/^[0-9]*$/)) {
//Great, continue executing the script.
}
else
{
//Force show a tooltip asking the user to numerically type the text.
}
});
});
To create a tooltip, add the data-toggle="tooltip" attribute to an element. Note: Tooltips must be initialized with jQuery: select the specified element and call the tooltip() method.
Single element To make an element display its tooltip permanently, we use its showTooltipOn property. To make tooltip always be shown, set it to "always" .
You want to show tooltip without mouseover? Then it's not called tooltip. Just use a usercontrol or even a textblock to do it. You position this control to where you want it and set visibility / or opacity to control how long you want to show it.
By default, tooltips will not be displayed on disabled elements. However, you can enable this behavior by using the following steps: Add a disabled element like the button element into a div whose display style is set to inline-block . Set the pointer event as none for the disabled element (button) through CSS.
To trigger a tooltip to show up you need to use the 'show'
option of the tooltip. Here is an example.
$('#element').tooltip('show')
Replace #element
with your own selector.
To add title using Jquery itself you can do this
$('#element').tooltip({title:"test title"})
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