htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
multiple areas - again


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


s1738berger
New User

Feb 10, 2005, 6:06 AM

Post #1 of 1 (2527 views)
Shortcut
multiple areas - again Can't Post

Hi all,
I try to replace some, not all textarea on one page. When I use the initEditor function several times with a new editor everything works fine. Her the example:


var editor = null;
unction initEditor(ta)
{
editor = new HTMLArea(ta);
editor.config.toolbar = ......;
setTimeout(function() { editor.generate(); }, 500);
return false;
}

onload call: initEditor('ta1');

Like this I have to create a new function (editor1, editor2, ...) for every textarea box.
Tp simplify all I tried something like:


var editor = new Array();

function initEditor()
{
for (var i=0; i<initEditor.arguments.length; i++)
{
var theName = initEditor.arguments;
editor[theName] = new HTMLArea(theName);
editor.config.toolbar = ......;
setTimeout(function() { editor[theName].generate(); }, 500);
}
return false;
}

and the onload call: initEditor('ta1','ta2','ta3');

That seems to work more or less, the only strange thing is that all the editors are loaded over one textareabox- > see the attachment. Same behaviour in Firefox and IE 6.
Anyone can help me with my weak javascript knowledge? Thanks in advance.

Stefan


(This post was edited by s1738berger on Feb 10, 2005, 6:12 AM)
Attachments: ta.jpg (39.8 KB)

 
 
 


Search for (options)