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

New User

Feb 8, 2005, 5:55 PM

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


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


New User

Feb 17, 2005, 7:27 AM

Views: 34924
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:

  	</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?


Feb 17, 2005, 8:47 AM

Views: 34906
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! :)