Comments on: Tooltips for Forms http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/ Coding for the Web - A JavaScript Resource Mon, 26 Jul 2010 12:53:41 -0400 hourly 1 http://wordpress.org/?v=3.0 By: Irradcacifs http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-1330 Irradcacifs Thu, 12 Nov 2009 19:21:47 +0000 http://stansight.com/WordPress/?p=14#comment-1330 I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you! Sorry for offtopic I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

]]>
By: Marten Gallagher http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-113 Marten Gallagher Tue, 24 Feb 2009 16:57:52 +0000 http://stansight.com/WordPress/?p=14#comment-113 Thanks - I am not a programmner but am a logical person so I managed to fiddle and add three variables to the htmlcode part so that the tooltip can be thrown aroudn anywhere. My next step is to get it to draw messages from a standard bank of messages in a textfile. Will keep you posted. And yes you are right - the detialed comments helped a non-programmer sort through it logically. Latest incarnation: http://www.martengallagher.co.uk/css/tooltips.js Thanks – I am not a programmner but am a logical person so I managed to fiddle and add three variables to the htmlcode part so that the tooltip can be thrown aroudn anywhere.

My next step is to get it to draw messages from a standard bank of messages in a textfile. Will keep you posted.

And yes you are right – the detialed comments helped a non-programmer sort through it logically.

Latest incarnation:
http://www.martengallagher.co.uk/css/tooltips.js

]]>
By: Stan Slaughter http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-112 Stan Slaughter Tue, 24 Feb 2009 15:01:41 +0000 http://stansight.com/WordPress/?p=14#comment-112 Glad you are finding it of some use. I tried to design it so it would be easy for any to customize and change the code to suit their needs. (One of the reasons there are almost as many comments as there is code :) ) To make the tip appear to the right you need to just add the width of the form element to the tip_left position. You would do this under the current line 47. So this: <strong> // Add obj height to top position so tip box DIV will show up underneath "obj" tip_top += obj.offsetHeight; </strong> would become this: <strong> // Add obj height and width so tip box will show up underneath and to the right of "obj" tip_top += obj.offsetHeight; tip_left += obj.offsetWidth;</strong> Glad you are finding it of some use. I tried to design it so it would be easy for any to customize and change the code to suit their needs. (One of the reasons there are almost as many comments as there is code :) )

To make the tip appear to the right you need to just add the width of the form element to the tip_left position. You would do this under the current line 47. So this:

// Add obj height to top position so tip box DIV will show up underneath “obj”
tip_top += obj.offsetHeight;

would become this:

// Add obj height and width so tip box will show up underneath and to the right of “obj”
tip_top += obj.offsetHeight;
tip_left += obj.offsetWidth;

]]>
By: Marten Gallagher http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-111 Marten Gallagher Mon, 23 Feb 2009 22:27:03 +0000 http://stansight.com/WordPress/?p=14#comment-111 And one last query - is itpossible to change something somewhere so the offset is to the right or to the left rather thannunderneath.A drop-down box obscures the tooltip. http://www.martengallagher.co.uk/experimenting/form.html Section 02 - hover over 02a1 red or Section 06 - hover over 'Which building material do you prefer?' These would be places where the better ofset might be to the left of the origin. Any thoughts? Am very impressed with it thus far and am hoping to build it into my 'search for the definitive form' of which that page is the experimental base. And one last query – is itpossible to change something somewhere so the offset is to the right or to the left rather thannunderneath.A drop-down box obscures the tooltip.

http://www.martengallagher.co.uk/experimenting/form.html

Section 02 – hover over 02a1 red
or
Section 06 – hover over ‘Which building material do you prefer?’

These would be places where the better ofset might be to the left of the origin. Any thoughts?

Am very impressed with it thus far and am hoping to build it into my ‘search for the definitive form’ of which that page is the experimental base.

]]>
By: Stan Slaughter http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-110 Stan Slaughter Mon, 23 Feb 2009 22:15:03 +0000 http://stansight.com/WordPress/?p=14#comment-110 "How would I go about setting the width to a fixed width" Change line 114 from this: "var tip_width = (iNumChars * iCharWidth + 6 > iMaxWidth ) ? iMaxWidth : iNumChars * iCharWidth + 6;" to this: "var tip_width = XXXX" Where XXXX is the fixed width you want it to be. “How would I go about setting the width to a fixed width”

Change line 114

from this:

“var tip_width = (iNumChars * iCharWidth + 6 > iMaxWidth ) ? iMaxWidth : iNumChars * iCharWidth + 6;”

to this:

“var tip_width = XXXX”

Where XXXX is the fixed width you want it to be.

]]>
By: Marten Gallagher http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-109 Marten Gallagher Mon, 23 Feb 2009 21:36:10 +0000 http://stansight.com/WordPress/?p=14#comment-109 Oh, and Firefox/Mac OSX 10.4.11 and Safari/Mac OSX 10.4.11 Oh, and Firefox/Mac OSX 10.4.11 and Safari/Mac OSX 10.4.11

]]>
By: Marten Gallagher http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-108 Marten Gallagher Mon, 23 Feb 2009 21:30:07 +0000 http://stansight.com/WordPress/?p=14#comment-108 Oh and for information it works on IE8/XP and in IE8/Windows 7 and in Chrome/XP and Chrome/Windows 7 Oh and for information it works on IE8/XP and in IE8/Windows 7 and in Chrome/XP and Chrome/Windows 7

]]>
By: Marten Gallagher http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-107 Marten Gallagher Mon, 23 Feb 2009 21:28:05 +0000 http://stansight.com/WordPress/?p=14#comment-107 I have just worked it out and I am so embarrassed! I had copied from the web page and included all the line numbers! Aaarrgghh! But while you're there...I want to do all the styling outside in an external css file...so have been trying to comment out the css style lines but it gets a bit tangled with the size of the box calculation bit. How would I go about setting the width to a fixed width and the allowing it to adjust the height normnallylike any block of html? I have just worked it out and I am so embarrassed! I had copied from the web page and included all the line numbers!

Aaarrgghh!

But while you’re there…I want to do all the styling outside in an external css file…so have been trying to comment out the css style lines but it gets a bit tangled with the size of the box calculation bit. How would I go about setting the width to a fixed width and the allowing it to adjust the height normnallylike any block of html?

]]>
By: Stan Slaughter http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-106 Stan Slaughter Mon, 23 Feb 2009 20:01:30 +0000 http://stansight.com/WordPress/?p=14#comment-106 Martin, With out seeing how your are using it, I'm not sure if I can help - but does your "msg" contain single or double quote marks ? Also were you using IE8 ? I've not tested it against that yet. Martin,

With out seeing how your are using it, I’m not sure if I can help – but does your “msg” contain single or double quote marks ?

Also were you using IE8 ? I’ve not tested it against that yet.

]]>
By: Marten Gallagher http://stansight.com/WordPress/2007/10/17/tooltips-for-forms/comment-page-1/#comment-105 Marten Gallagher Mon, 23 Feb 2009 17:56:00 +0000 http://stansight.com/WordPress/?p=14#comment-105 Am getting this eror: missing ; before statement 16. function Tooltips(msg,displayseconds) { \n What might I have done wrong? Am getting this eror:

missing ; before statement
16. function Tooltips(msg,displayseconds) { \n

What might I have done wrong?

]]>