Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Problem with HTMLArea.init() and using on the fly



kelly13
New User

Feb 8, 2005, 5:55 PM


Views: 33580
Problem with HTMLArea.init() and using on the fly

Hello!

I use htmlarea alternatively to normal textareas: When a user checks a checkbox the mode toggles and the editor will load on the fly. I have the problem, that sometimes - not always - the error "ERROR! You must called HTMLArea.init() first." appears.
I tried many variants: to call HTMLArea.init() while pageloading or to call just before call the .generate-object-function or to use windows.settimeout()-function to delay the .generate after call the .HTMLArea.init()-function

I can't use the "HTMLArea.onload=function() {" method, because it seems not possible to initialize this function in another function (which I need to load the editor on the fly).

any Ideas?

Thanks in advance

Kelly.


krys
New User

Feb 17, 2005, 7:27 AM


Views: 33426
Re: [kelly13] Problem with HTMLArea.init() and using on the fly

I've the same problem.

I'm using HTMLarea in a CMS, on page start where the body is sent, i'cant send the init just because the cms-body isn't inserted and the code doesn't know which name the editor has. This is initiated within the body-tag:


Code
  	</tr>	<tr>		<td>		<script type="text/javascript">			_editor_url = "/includes/htmlarea/";			_editor_lang = "de";		</script>		<script type="text/javascript" src="/includes/htmlarea/htmlarea.js"></script>		<script type="text/javascript">			HTMLArea.init();						function initDocument(area,height) {									var editor = new HTMLArea.replaceAll(); 												editor.generate();			}								</script><script type="text/javascript">HTMLArea.onload = initDocument('content_editor','350px')</script>	<TABLE width="100%" CELLPADDING=0 CELLSPACING=0 BORDER=0>		<FORM ACTION="/dcms/content_list&content_id=332&action=save_content" METHOD=post>



with the old version this wasn't a problem ...



what can i do?


jamirae
Novice

Feb 17, 2005, 8:47 AM


Views: 33408
Re: [krys] Problem with HTMLArea.init() and using on the fly

check out this post I think your answer may be here.. at least it worked for me! :)

http://www.htmlarea.com/forum/htmlArea_3_(beta)_C4/htmlArea_v3.0_-_Discussion_F14/htmlArea_fails_to_load_properly_P28794/