Click to See Complete Forum and Search --> : WebBrowser Question


Tricky123
12-29-2002, 03:25 AM
Hi,

Can anyone tell me how to call a JavaScript function from a Visual Baisc event (_click). My JavaScript is part of an HTML form in a WebBrowser component in a VB application.

I have accessed HTML textareas from VB using

text1.text = document.all.textarea.value

This is a VB declaration that uses the DOM.

TIA

Tricky123
12-30-2002, 04:05 AM
Not exactly.

I have read at:

http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/tutorials/forward.asp

that the attachEvent method can be used to bind functions in dHTML to VB events. However, I am a little confused as to how this works.

I guess that attachEvent is a script method? Is this a solution?

Many thanks

Tricky123
12-30-2002, 06:21 AM
The solution is the VB line

WebBrowser1.Document.All("nameOfButton").event

where event is onClick, onBlur etc and
WebBrowser1 is the name of the webbrowser ActiveX component