Malcolm Bisset


I have a vfp form with a browser activex control (which I've named ole1). I use the browser to display an html page which uses javascript to create a text editor object like this:

var oFCKeditor = new FCKeditor( 'FCKeditor1' )

And then (again in javascript) I can set up the text to be edited like this:

oFCKeditor.Value = "Some html <b>text</b> here"

Is there a way of accessing the oFCKeditor object from foxpro after the page has been displayed I've tried something like Thisform.ole1.document.oFCKeditor.value but that doesn't work.

Malcolm




Re: Problem with Browser activex control

SharathMum



Thisform.ole1.OBJECT.Document.oFCKeditor.Value

check this example Loading HTML into a WEB Browser Control from Variable






Re: Problem with Browser activex control

Malcolm Bisset

Thx, SharathMum. That is a good example of using .document to write to the browser.

However my problem comes later, having written the html page which creates a javascript object, I need to then access the properties of that javascript object from foxpro.

To put it another way, after javascript creates an object with something like var oObject = new someobject('xxx') is there a way of getting at its properties from the browser control rather than referencing them from within the html/javascript page itself. Is there some code like thisform.oWeb.document.object(1).[someproperty]






Re: Problem with Browser activex control

Alex Feldstein

You can take a reference to the HTML form:

oFrm = This.Object.Document.myForm

Then refer to the form's objects:

If oFrm.elements.Length > 0
For Each oElem In oFrm.elements
oElem.Name
EndFor
EndIf

HTH





Re: Problem with Browser activex control

Malcolm Bisset

Thanks Alex ... that did the trick!

Actually, my editor object wasn't listed as an element or the form, but it was in the 'item' collection, so I got there.

Many thanks for your help.

Malcolm