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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

catching event from activex-object

Status
Not open for further replies.

TomasE

Programmer
Aug 4, 2002
6
SE
I'm having trouble catching events from an ActiveX-control on my webpage. Im using the following code to catch it.

<SCRIPT LANGUAGE=vbscript FOR=object1 EVENT=SelChange>
<!--
MsgBox(&quot;test&quot;)
//-->
</SCRIPT>
[/blue]

It works perfectly fine when I use javascript (LANGUAGE=javascript) but when I replace that with vbscript, nothing happens, as if the event never triggered.

If I remove the FOR and EVENT parameters the script is executed, so the vbscript interpreter seems to work fine.

Btw, the object is a MS MonthView-control.

Would really appreciate help on this.

/Tomas
 
Hello Tomas,

How about adding an apostrophe?

'//-->

regards - tsuji
 
Actually:

<SCRIPT LANGUAGE=vbscript FOR=object1 EVENT=SelChange>
<!--
MsgBox(&quot;test&quot;)
-->
</SCRIPT>

... is correct.
 
Dilettante,

Just a quick note: '//--> let vbscript & javascript feel comfortable that's my sole reason as TomasE switch back & forth between the language.

-tsuji
 
Hello again,

Also, as I remember I had posted in a recent thread on a similar point where unfortuately I get no response from the original poster whether it helped or not, that on the msgbox line, take away the paratheses if no return is needed!!!

<!--
MsgBox &quot;Test&quot;
'-->

regards - tsuji
 
Thanks for your suggestions. Unfortunately the problem remains, no matter what I do.

I've come up with a (rather ugly) temporary solution though. I catch the event in the javascript and call the vbscript from there. The reason I must use vbscript is because I need to send a DATE-object to an ActiveX-control, and I haven't found that datatype in JS.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top