Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Want to trigger onclick event in vbscript

451 views
Skip to first unread message

Jim Roehl

unread,
Nov 4, 2000, 3:00:00 AM11/4/00
to

I'm trying to trigger an onclick event in my client-side vbscript, something
on the order of:

window.tab(1).click = true

This obviously is not correct snytax. Can anyone help me out?

Michael Harris

unread,
Nov 4, 2000, 3:00:00 AM11/4/00
to

One of several ways is:

set window.tab(1).onclick = GetRef("myTabOnClickHandlerProcedureName")

which requires VBScript 5.0 or higher on the client...

And you need to connect each instance of "window.tab(n)" to a handler this way.

================

Or in the HTML element that defines whatever "tab" is, you can also give the onclick attribute a
value...

<.... id="tab" onclick="vbscript:myTabOnClickHandlerProcedureName()" ...>

================

Or simply name the procedure

Sub tab_onclick()
...
End Sub

================

Since you obviously have multiple instances of "tab", you'll also need to use

set theTab = window.event.srcElement

inside the handler to get an object reference to which "tab" was clicked...

You can find all of this info by reading the DHTML and VBScript documentation (sometimes between the
lines ;-)...

MSDN Online Web Workshop - DHTML, HTML & CSS Home
http://msdn.microsoft.com/workshop/author/default.asp

VBScript User's Guide
http://msdn.microsoft.com/scripting/vbscript/doc/vbstutor.htm
VBScript Documentation
http://msdn.microsoft.com/scripting/vbscript/techinfo/vbsdocs.htm
http://msdn.microsoft.com/scripting/vbscript/download/vbsdoc.exe


--
Michael Harris
Microsoft.MVP.Scripting
--
"Jim Roehl" <jro...@tir.com> wrote in message news:uRlt6aoRAHA.195@cppssbbsa05...

Jim Roehl

unread,
Nov 6, 2000, 3:00:00 AM11/6/00
to
It turns out that just plain "window.tabs(1).click()" gives me what I want.
0 new messages