This is a migrated thread and some comments may be shown as answers.

How to add ToolTip using Javascript

1 Answer 189 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Richard M
Top achievements
Rank 1
Richard M asked on 11 Nov 2010, 12:32 AM
I would like to use one ToolTip for multiple buttons.  The ToolTip has custom content which includes text, buttons, checkboxes.  My plan is to create a Javascript function to bring up the ToolTip when the button is clicked on. 

First, I would add the Javascript function to the client click event of my buttons:
Button1.Attributes.Add("OnClick","myFunction()");
Button2.Attributes.Add("OnClick","myFunction()");

Then I need to create a Javascript function (called myFunction) to bring up the tooltip:
function myFunction()
{
     // code goes here
}

How do I attach and bring up a ToolTip in Javascript?

1 Answer, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 11 Nov 2010, 04:13 PM
Hello Richard M,

 Straight to your questions:

1) To programmatically show a tooltip you should set ShowEvent="FromCode", reference the tooltip and call its method show()

2) If you want not only to programmatically show but also to create dynamically a tooltip on the client you should use the RadToolTipManager's createToolTip method as shown in the demo below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/radtooltipmanagerclientapi/defaultcs.aspx

I hope that my reply is detailed enough and helpful, let me know how it goes.

Best wishes,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ToolTip
Asked by
Richard M
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or