Autotooltipify property and img alt tag

12 posts, 0 answers
  1. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 03 Mar 2009 Link to this post

    We wanted to use something better than "title" property on our control to see a beautiful tooltip everywhere.

    I saw that on the telerik documentation: (source Telerik documentation for autotooltipify property)
    Gets or sets a value whether the RadToolTipManager, when its TargetControls collection is empty will tooltipify automatically all elements on the page that have a 'title' attribute   

    Wonderful ! I only have to put a radtooltipmanager on my masterpage and every title will be converted to beautiful tooltip !

    BUT ???

    Ok, title are converted to tooltip.  But not only title, ALT also.  I have a lot <img src="..." alt="..."> tags on my pages and I do not want alt to be converted to tooltip !  How can I have only my TITLE property converted to tooltip, not my ALT property ?
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 06 Mar 2009 Link to this post

    Hello Dani,

    The RadToolTip is designed to replace the standard browser tooltip and the standard tooltip shows when there is an alt property set and that is why this behavior when Autotooltipify is true is the correct one. You can achieve the desired behavior by adding the controls that you want to tooltipify to the RadToolTipManager's TargetControls collection instead of using the autotooltipify functionality as shown in our online demos below:

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

    All the best,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dani
    Dani avatar
    55 posts
    Member since:
    Jan 2009

    Posted 06 Mar 2009 Link to this post

    Ok so it seems that we were not using the ALT and TITLE property correctly, we were using ALT to display an alternate text if the image is not present , and the TITLE for the tooltip.  These were 2 different use of those properties.  And we never saw any tooltip on controls using only the ALT property before using the autotooltipify property.  Also, your documentation clearly say that the TITLE property will be replaced by the tooltipmanager, no mention about the ALT property.  Maybe some browsers are considering the ALT as a tooltip too... I suppose that's why you convert alt and title in tooltip...

    We will modify our code to use the manual tooltip manager without the autotooltipify property.

    Thank you.
  5. Nicolaï
    Nicolaï avatar
    160 posts
    Member since:
    Apr 2008

    Posted 26 Jan 2010 Link to this post

    Shouldn't it skip the alt tags for images?
    Is there a way to configure AutoTooltipify to skip alt tags on images, but tooltipify everything else?

    Edit: well, using ToolTipZoneID can work in some situations..
  6. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 29 Jan 2010 Link to this post

    Hello guys,

    Note, that as already explained one of the main purposes [among others] of RadToolTip is to be used as a replacement of the "standard browser tooltip". This is the reason that the tooltip, as its highest priority reads the title or alt attribute of the element (as it is the title/alt attribute that causes a browser tooltip to be displayed).

    Since the tooltip manager used to work like above explained from its creation when autotooltipify is used, we got customers` requests to make this behavior consistent for populated TargetControls collection
    and the same for the separate RadToolTip as well.

    That is why even if you add the controls to the TargetControls collection, the Alt will be removed.

    What I can suggest to do in order achieve what you need is to use some simple js code as the one shown below which I prepared for you:

     

    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager
        <script type="text/javascript"
            
        function setToolTip() 
        
           var img = $get("<%=imgRating.ClientID %>"); 
           var alt = img.getAttribute('alt'); 
           var regTooltip = img.getAttribute('regulartooltip'); 
           if(!alt || alt == '') img.setAttribute('alt', regTooltip); 
        }         
            
        </script
        <img src="Sunset.jpg" runat="server" onmouseover="setToolTip();"
            regulartooltip="myStandardTooltip" id="imgRating" alt="Rate this Page" width="55"
            height="16" /> 
        <telerik:RadToolTip runat="server" ID="tipRating" Title="What do you think?" Skin="Office2007"
            Animation="None" xManualClose="true" Sticky="false" ShowEvent="OnMouseOver" HideEvent="LeaveTargetAndToolTip"
            Width="275" Position="BottomLeft" RelativeTo="Element" OffsetX="0" OffsetY="0"
            TargetControlID="imgRating" IsClientID="false"
            Enter an optional comment with your rating: 
            <textarea id="tbRatingComment" rows="3" cols="30"></textarea
            <small>Report technical problems with this site to the <a href="mailto:sasupport@case.edu"
                webmaster</a>.</small
        </telerik:RadToolTip
    </form>

    The sample code uses a separate tooltip but it can be easily customized for RadToolTipManager as well (you should reference the corresponding RadToolTip by using the tooltipManager.getToolTipByElement method).



    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 03 Mar 2010 Link to this post

    Hi,

    I have to agree with Dani here, the ALT text property is not meant to be tooltip material, it's meant to display when the image url is broken and for screen readers. TITLE is the tag to use for tooltips...

    I don't have a problem with RadToolTip replacing the tooltip, but please, only replace the tooltips, nothing more.

    Run this in IE 8 or FF without RadToolTipManager and you'll only get one tooltip....
          <img src="missing" alt="This is the alt text" /> 
          <img src="button.png" alt="Button alt text" /> 
          <img src="button.png" alt="Button alt text" title="Tooltip text" /> 

    Run it with RadToolTipManager and you'll get three. This is inconsistent and unwanted behavior... as least for me.

    Thanks for considering this,

    Dominic.
  8. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 08 Mar 2010 Link to this post

    Hi dstj,

    If you test the code under IE6 and IE7 you will notice that all the Alt attributes are shown as tooltips. There is no way to prevent this from happening since this is browser specific behavior and in this case if we do not remove the Alt attribute you will always get two tooltips - one standard and one which is  RadToolTip and thus after some research and discussions we have decided to remove the Alt when tooltipifying. This was so for AutoToolTipify functionality from the creation of the RadToolTipManager control and recently we implemented the same logic for a separate RadToolTip as well due to customers' requests for consistency.

    Regards,
    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.
  9. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 08 Mar 2010 Link to this post

    You can't really base design changes today based on two obsolete, and non-compliant, browsers ?

    Seems like an odd thing to do...

    Dominic.
  10. Nicolaï
    Nicolaï avatar
    160 posts
    Member since:
    Apr 2008

    Posted 09 Mar 2010 Link to this post

    Neither of them are obsolete (ie 6&7).
    In fact, ie6 is probably used more than we'd like to think:
    http://www.w3schools.com/browsers/browsers_stats.asp

    Most of my users (~90%) are on ie6... Corporations are very slow to change...



  11. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 09 Mar 2010 Link to this post

    Hi Nicolai,

    We won't start that debate here and now. ;) I worked in a bank for a while who upgraded to Windows XP (from NT4) in 2006(!) and even they installed IE7... And even Google has officially announced it drops IE6 support.

     So, my point is that if IE6 and 7 do it one way and IE8 does it another way, it seems to indicate that the mentioned feature has no real future.

    Sitenote: Don't base browser stats on w3shools, it's for web developers who know what they are doing. But god would I love to that 45+% of Firefox ! :)
  12. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 10 Mar 2010 Link to this post

    Hi guys,

    IE6 and IE7 browsers are not obsolete yet as you can see from the statistics below:

    http://www.w3schools.com/browsers/browsers_stats.asp

    As you see, these browsers are still heavily used and especially by big corporations as Nicolai also said.

    Note, also , that the RadToolTip control was created before IE8 was released and at that time those browsers were the most used ones and we believe that the behavior should not be changed only because a new browser was released and all we did was to make the already used behavior consistent due to customers' requests we received. However, we are gathering feedback and if it turns out that more people prefer to change the behavior we will consider do that.

    Greetings,
    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.
  13. Grant Henderson
    Grant  Henderson avatar
    9 posts
    Member since:
    Jun 2004

    Posted 16 Oct 2011 Link to this post

    Looks like someone at Telerik was listening.

    There is now an IgnoreAltAttribute property.  Set to true it ignores ALT attributes in images.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017