Tooltip does not hide with a validation control in it.

2 posts, 0 answers
  1. Paul Corbett
    Paul Corbett avatar
    19 posts
    Member since:
    Jan 2008

    Posted 01 Feb 2008 Link to this post

    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?


  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 04 Feb 2008 Link to this post

    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
Back to Top