Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


utilizing ID on event

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,6
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> utilizing ID on event
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 utilizing ID on event - 5/22/2001 11:52:47 PM   
  Mighty

 

Posts: 11
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
When an ID is assigned to a TR or a TD, does anyone know how to retrieve and USE the ID on an event? I can't figure out how to pass this value in a manner that it is an object and not a string - so I can use it along with the properties (e.g. IDNAME.Style.Color = "Black").

Example:
We are showing a listing of employees - this will be a flexible number. Each employee has an unique identifier. I've placed my code to create a <TR> for each record, and the ID has been assigned "ENGR" + the Unique Identifier.

When a user moves the mouse over a row, I would like the color to change depicting when the cursor is over it using the onmouseover event.

The problem is that since there are a varying number of rows, I don't have a set number to run a CASE statement against. It would be nice if somehow the parameter of the ID name is passed, and my event script accepts and is able to USE the parameter as the object itself.

Hopefully this makes sense. ;) Thanks for the help.
 
 
Post #: 1
 
 Re: utilizing ID on event - 5/22/2001 11:54:02 PM   
  subnation

 

Posts: 20
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
I think I understand your question and the answer is pretty simple. When you're creating your TD and assigning it an ID, also give some event code that will pass itself to the function that will do something with it.

Something like this:

... ID="ENGR" & intLoop & " OnMouseOver='HighlightMe(me)'" & ...

The answer to what you're looking for is the "me" part. Using "me" in VBScript (and using "this" in JavaScript) passes a reference to the element itself.

Then your Highlight function would receive the object:

Sub Highlight(ByRef objElement)
objElement.Style.color = "Black"
End Sub

Hope that helps.

(in reply to Mighty)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> utilizing ID on event Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts