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

Autotooltipify property and img alt tag

11 Answers 223 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Bridge24
Top achievements
Rank 1
Iron
Bridge24 asked on 03 Mar 2009, 02:34 PM
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 ?

11 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 06 Mar 2009, 12:01 PM
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.
0
Bridge24
Top achievements
Rank 1
Iron
answered on 06 Mar 2009, 02:45 PM
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.
0
Nicolaï
Top achievements
Rank 2
answered on 26 Jan 2010, 10:07 AM
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..
0
Svetlina Anati
Telerik team
answered on 29 Jan 2010, 08:34 AM
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.
0
dstj
Top achievements
Rank 1
answered on 04 Mar 2010, 12:40 AM
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.
0
Svetlina Anati
Telerik team
answered on 08 Mar 2010, 03:12 PM
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.
0
dstj
Top achievements
Rank 1
answered on 08 Mar 2010, 04:09 PM
You can't really base design changes today based on two obsolete, and non-compliant, browsers ?

Seems like an odd thing to do...

Dominic.
0
Nicolaï
Top achievements
Rank 2
answered on 09 Mar 2010, 01:20 PM
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...



0
dstj
Top achievements
Rank 1
answered on 09 Mar 2010, 03:26 PM
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 ! :)
0
Svetlina Anati
Telerik team
answered on 10 Mar 2010, 12:52 PM
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.
0
Grant Henderson
Top achievements
Rank 1
answered on 16 Oct 2011, 09:42 AM
Looks like someone at Telerik was listening.

There is now an IgnoreAltAttribute property.  Set to true it ignores ALT attributes in images.
Tags
ToolTip
Asked by
Bridge24
Top achievements
Rank 1
Iron
Answers by
Svetlina Anati
Telerik team
Bridge24
Top achievements
Rank 1
Iron
Nicolaï
Top achievements
Rank 2
dstj
Top achievements
Rank 1
Grant Henderson
Top achievements
Rank 1
Share this question
or