Show Tooltip onMouseOver & onFocus

2 posts, 0 answers
  1. rdochert
    rdochert avatar
    82 posts
    Member since:
    Oct 2012

    Posted 22 May 2008 Link to this post

    i've built a form which has tooltips defined for each row of the table the form is layed out on. using the mouse to go to a particular field within the form is great because the tooltips show as you mouse over each element - even mousing over the prompts shows the tooltips because they are in the same table row as the field and the title= is defined on the table row.

    the only issue is that the forms tend to be long and most users will tab from field to field instead of using their mouse. that means they may not see the tooltips. so, what i want to do is have the onfocus of the form fields call a function to show the tooltip that relates to them. But how to do that? How do i get a reference to the instance of the tooltip for that particular row of the table?

    any pointers gratefully received.

    one other approach to this as a fallback option would be to have the tooltip only on the form fields and make it respond to both onMouseOver and onFocus. Is that possible?

    thanks,
    rob
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 26 May 2008 Link to this post

    Hi Rob,

    I am not quite sure how exactly you show the RadToolTip - by using a RadToolTipManager or by using separate RadToolTip controls.

    I have a few suggestions but they depend on your exact scenario. What I can suggest is:

    1. If you are using separate RadToolTip controls you can declare two RadToolTips for each target control and set their ShowEvent to OnMouseOver and OnFocus. This will simulate the desired behavior.
    2. If you are using separate RadToolTip controls you can hook up the onfocus event of the target control and show the RadToolTip after obtaining a reference to it in the following manner:

       function showToolTip()  
              {  
                   var tooltip = $find("<%= Radtooltip1.ClientID %>");  
                   tooltip.show();        
              } 


         <asp:TextBox ID="TextBox2" runat="server" onfocus="showToolTip()"></asp:TextBox> 
    3. In case you are using RadToolTipManager control I suggest that you put two RadToolTipManager controls on your page with the same target controls in their TargetControls collections and specify the particular ShowEvent properties for each of them.

    I hope that you will find my suggestions helpful. In case you experience problems with the implementation of the mentioned above, please open a new support ticket and send me a sample project with a detailed explanation of the experienced problems.

    Best wishes,

    Svetlina
    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
Back to Top