Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-10-08 21:51:12

seanodonnell
New member
Registered: 2005-10-08
Posts: 3

Problem with getHtml

Hi There ,

I am dynamically creating and removing a html area for a page (its used for the extended portion of a blog post
so for short posts its just unnecessary). However, before I remove it from the page I want to save its content,
it case the user changes their mind and turns in back on.

I create the neweditor like this

eeditor = new HTMLArea("eextended",HTMLArea.cloneObject(xinha_config));
                        eeditor.registerPlugins(xinha_plugins);
                        eeditor.generate();


what is being replaced is a textarea that I create on the fly like this

eeditor = document.createElement("TEXTAREA");
                        eeditor.value = extendedbody;
                        td1.appendChild (document.createTextNode("Extended Body"));
                        eeditor.rows=20;
                        eeditor.cols=80;
                        eeditor.name="eextended";
                        eeditor.id="eextended";

eeditor is a global variable so I can get hold of it later, now when , just before the htmlarea is removed, i try
and access the current content to store it

extendedbody=eeditor.getHtml();

I get a object does not support this property or method

I have the getHtml plugin registered in the config file

xinha_plugins = xinha_plugins ? xinha_plugins :
        [
                'CharacterMap',
                'ContextMenu',
                'FullScreen',
                'ListType',
                'Stylist',
                'InsertAnchor',
                'FindReplace',
                'Equation',
                'SuperClean',
                'GetHtml',
                'TableOperations'
         ];

And I can see the other plugins are loaded, so does anyone have any ideas as to where I am going wrong?

Thanks

Sean

Offline

#2 2005-10-10 15:00:35

wymsy
Xinha Community Member
From: Massachusetts, USA
Registered: 2005-04-01
Posts: 44
Website

Re: Problem with getHtml

Does it work if you *don't* load the GetHtml plugin?

Offline

#3 2005-10-10 16:23:31

seanodonnell
New member
Registered: 2005-10-08
Posts: 3

Re: Problem with getHtml

Just gave that a try, it made no difference sad

Offline

#4 2005-10-10 21:03:04

wymsy
Xinha Community Member
From: Massachusetts, USA
Registered: 2005-04-01
Posts: 44
Website

Re: Problem with getHtml

That indicates that the problem is not in the plugin or your config. You seem to be using the variable eeditor for two different purposes, one as the name of the editor object, the other as the name of the textarea. When you execute the line 'extendedbody=eeditor.getHtml();', does eeditor refer to the textarea? If so, that's your problem. getHTML() only applies to the editor object.

Offline

#5 2005-10-10 22:22:35

seanodonnell
New member
Registered: 2005-10-08
Posts: 3

Re: Problem with getHtml

I am a moron (*Sound of head smacking wall repeatedly*)

I downloaded and installed venkman (not working off my own laptop , it blew up last week and Im waiting for the replacement), and verified that eeditor was indeed pointing at the editor object. So I started fooling around with some watches, and ........

I was calling .getHtml() instead of .getHTML(), HTML has to be in caps, doh doh doh

Thank you all very much for your help

Sean

Offline

Board footer

Powered by FluxBB