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

Tooltip does not hide with a validation control in it.

1 Answer 117 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Paul Corbett
Top achievements
Rank 1
Paul Corbett asked on 01 Feb 2008, 12:00 PM
Hi,

I have a regular validation control inside a tooltip.

What I like to do is only show the tooltip when there is a message in the validation control. I have  added this method on OnClientBeforeShow event of the tooltip

        function CheckIfShow(sender, args) 
        { 
            var summaryElem = document.getElementById("rfvFirstName"); 
              
            //check if summary is visible 
            if (summaryElem.style.display == "none") 
            { 
                //API: if there are no errors, do not show the tooltip 
                var tooltip = $find("<%= RadToolTip1.ID %>"); 
                tooltip.hide(); 
            } 
        } 

or per one of your samples

            //check if summary is visible 
            if (summaryElem.style.display == "none") 
            { 
                //API: if there are no errors, do not show the tooltip 
                args.set_cancel(true); 
            } 

but neither of this works. The tooltip pops up with empty content when I enter the text box.

any suggestions?


1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 04 Feb 2008, 12:00 PM
Hello Chris Lekkas,

I checked your code and I noticed the following:
1. By checking the validation control's display you decide whether to show or not the tooltip. If there were not validation errors you "prevent" the tooltip to show by args.set_cancel(true). You cannot hide the tooltip by using tooltip.hide() because it is still not shown.

2. Make sure that you have a function which shows the tooltip and is called when the validation is done.


I prepared a simple application which demonstrates the desired by you behavior. Please, find it attached.



Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Paul Corbett
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or