473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Passing a function to Zorns tooltip

HI,

I have this peice of code:
function showTooltip(elem)
{
var a = elem.form.elements['A1_1'].value;
var b = elem.form.elements['A1_2'].value;
var c = elem.form.elements['A1_3'].value;
var masterString = "123456789";
var notUsed = masterString.replace(a,'').replace(b,'').replace(c ,'');
var notUsedArray = notUsed.split()
}

I'm using Walter Zorns tooltip from http://www.walterzorn.com and I
would like to pass the notUsedArray into the text field of the tooltip,
but this seems to be impossible.

I have this also
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

A1_4.Attributes.Add("onmouseover", "return
escape(showTooltip('A1_4'))")

End Sub

Can anybody help as I'm going mad trying to fix this???

Thanks in advance.

Nov 23 '05 #1
4 1423
VK
> I have this peice of code:
function showTooltip(elem)
{
var a = elem.form.elements['A1_1'].value;
var b = elem.form.elements['A1_2'].value;
var c = elem.form.elements['A1_3'].value;
var masterString = "123456789";
var notUsed = masterString.replace(a,'').replace(b,'').replace(c ,'');
var notUsedArray = notUsed.split()
}
You cannot use split() w/o arguments: split over what? Not the most
effective but the most evident replacements would be:

// notUsedArray = notUsed.split() // not usable
var notUsedArray = [];
for (i=0; i<notUsed.length; i++) {
notUsedArray[i] = notUsed.charAt(i);
}
}

I'm using Walter Zorns tooltip from http://www.walterzorn.com and I
would like to pass the notUsedArray into the text field of the tooltip,
but this seems to be impossible.
Then I'm not sure why do you need array if it becomes a string?
Aniway the code above gives you the needed array - serve it where you
have to, I'm not a WalterZone specialist :-)
I have this also
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

A1_4.Attributes.Add("onmouseover", "return
escape(showTooltip('A1_4'))")

End Sub


Seems like VBA code. What is he doing here?

Nov 23 '05 #2
VK wrote:

<http://jibbering.com/faq/faq_notes/pots1.html>
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
var notUsedArray = notUsed.split()
[....]


You cannot use split() w/o arguments: [...]


You can.

,-[ECMAScript 3 Final, 15.5.4.14 String.prototype.split (separator, limit)]
|
| [...]
| If `separator' is undefined, then the result array contains just
| one string, which is the `this` value (converted to a string).

Implemented in JavaScript 1.5/6 and JScript 5.6/6 (.NET):

<http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Strin g:split>
<http://msdn.microsoft.com/library/en-us/jscript7/html/jsmthsplit.asp>
PointedEars
Nov 23 '05 #3
VK said the following on 11/13/2005 5:07 PM:
I have this peice of code:
function showTooltip(elem)
{
var a = elem.form.elements['A1_1'].value;
var b = elem.form.elements['A1_2'].value;
var c = elem.form.elements['A1_3'].value;
var masterString = "123456789";
var notUsed = masterString.replace(a,'').replace(b,'').replace(c ,'');
var notUsedArray = notUsed.split()
}

You cannot use split() w/o arguments: split over what? Not the most
effective but the most evident replacements would be:

// notUsedArray = notUsed.split() // not usable


It is very usable. Did you test it before you made the incorrect
assumption that you couldn't split without a parameter?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 23 '05 #4
Thank you for all the answers, and I do appreciate them, but the crux
of my problem is that I cannot pass a string from the function to the
tooltip.
I'm sure it's something simple but I can't see it in my head as I
understand VB but not java and I'm hoping to have this calculate
without having postbacks.

Thanks,

Marc

Randy Webb wrote:
VK said the following on 11/13/2005 5:07 PM:
I have this peice of code:
function showTooltip(elem)
{
var a = elem.form.elements['A1_1'].value;
var b = elem.form.elements['A1_2'].value;
var c = elem.form.elements['A1_3'].value;
var masterString = "123456789";
var notUsed = masterString.replace(a,'').replace(b,'').replace(c ,'');
var notUsedArray = notUsed.split()
}

You cannot use split() w/o arguments: split over what? Not the most
effective but the most evident replacements would be:

// notUsedArray = notUsed.split() // not usable


It is very usable. Did you test it before you made the incorrect
assumption that you couldn't split without a parameter?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim | last post by:
Using Intellisense, when you type a function name and the opening parenthesis, you get a tooltip that identifies the return type and arguments of the function. The argument list that is displayed...
0
by: Yves Royer | last post by:
Hi, I'm currently writing an application (in VS 2005 bèta 2) and made some own user controls. In each user control I added a ToolTip object so i can set some tooltips on checkboxes etc. What...
0
by: Yves Royer | last post by:
Hi, My first post didn't show up so here's a second try. I'm currently writing an application (in VS 2005 bèta 2) and made some own user controls. In each user control I added a ToolTip object...
1
by: Bryan | last post by:
Hello, I am taking values from a datatable and formatting them for use in a JavaScript Function Call. The end result is a mouse over tool tip. Here is what I am doing. I have tried to use...
3
by: Sam | last post by:
Hi, When a function of the framwork is being called by an object of its class, a tooltip pops up on the screen with the definition of the function as well as a description of what the function...
2
by: Justin Rowe | last post by:
I'm attempting to design a site with alot of dynamic content and intractability, however I've hit a snag when it comes to the function of the onMouseOver and onMouseOut events. Using a bit of code...
5
by: pbearne | last post by:
Hi guys I am trying to this function below I have a web form with a load of inputs text boxs etc and i need to disable them So I have tried to write a function I can call and get the...
5
by: =?Utf-8?B?cGV0ZTE5Njk=?= | last post by:
I use Visual Studio 2005 and created a very simple Form with one button. I added a Tooltip for that button. It shows fine the first time I hover over that button. But if I let it disappear by the...
16
by: Charles Law | last post by:
I have to take this personally now. Tooltips have been flakey since the dawn of .NET, but to still have to put up with a disappearing tooltip in VS 2008 is getting beyond a joke. Tooltips have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.