Andrew G. Johnson
Andrew G. Johnson

Reputation: 27003

Has anyone been able to edit text in an OpenWYSIWYG control dynamically?

Like the question says has anyone been able to take a OpenWYSIWYG control and change its contents dynamically with JavaScript? It's hard because it takes your textarea and transforms it into a WYSIWYG editor by making the textarea invisible and inserting some kind of iframe and uses that as the editor.

I've tried code like this but failed:

document.getElementById("textarea-wysiwyg").value = "BLARG";

Upvotes: 2

Views: 746

Answers (1)

Jack
Jack

Reputation: 21183

If you know that is it the only frame on the page then you can do something like this:

window.frames[0].document.body.innerHTML = 'blarg'

The above works when I tried it on http://www.openwebware.com/wysiwyg/demo.shtml in firebug.

Hope this helps...

Upvotes: 1

Related Questions