Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic tooltip

Status
Not open for further replies.

emissions

Technical User
Mar 17, 2002
68
0
0
GB
I'm basically looking to have a tooltip with additional information related to object within a database, I've been using this 'wz_tooltip';

onmouseover='return escape(" & objRecordset.Fields("Message") & ")' contained within <a> tag.

Nothing displayed. It does see something though as the empty fields display with 'undefined' and records with data in display nothing. Been at this for a day now, and tried different solutions, any help welcome...

 
I display database result in an ASP page. One of the fields I display in the result is Event. I want to use tooltips (or titles) to show the corresponding Message details of that particular Event when a user mouseover on a value of Event. For example, the table I show in an ASP is as under:

9.00am
Meeting with NAPA

(This will be hyperlinked to Detail Page) When a user mouseover on it, it will show the correspondng Message which will be in the same database as Events.

Can somebody help?
 
This is more of a client-side question than an ASP question, even though your adding the data that will be displayed from your ASP code.
One option would be to use the title attribute of your tag. This is usually shown as a tooltip when you hover over a link and wouldn't require any extra work on your part.

If you need additional capabilities beyond what the title gives you (like formatting capability) then you would want to look into using either javascript or CSS to generate your own tooltip. This would probably belong more in the JS or CSS forums.

It appears you are attempting to use a client-side function in your code above, but I have never heard of "wz_tooltip" so I couldn't even begin to gues what you might be doing incorrectly above. Again, this being javascript function, I would assume you could get better assistance in the Javascript forum.

barcode_1.gif
 
i ran into this problem before using this bit of code and the way i had to fix it was, create a function, then use that function on the data i wanted to display.
Code:
Function correctTooltip(varString)
	Dim t1, t2, t3, t4, t5, t6
	t1 = Replace(varString, "'", "\'")
	t2 = Replace(t1, "&", "&amp;")
	t3 = Replace(t2, """", "&quot;")
	t4 = Replace(t3, Chr(13) & Chr(10), " ")
	correctTooltip = t4
End Function
the function is used to replace some characters that may be in your string that wz_tooltip doesn't like.

then use this for displaying it:
Code:
onmouseover="return escape('<%=correctTooltip(objRecordset.Fields("Message"))%>')"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top