htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
editor_getHTML help! Please!


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.

 


impact
New User

Jan 25, 2004, 9:17 PM

Post #1 of 4 (2395 views)
Shortcut
editor_getHTML help! Please! Can't Post

I'am writting news management application and I am using HTML AREA (ver 2.03) in it.
Now, I am trying to get content from textarea with editor_getHTML() function, but I have problem.
Here is code:

...
<textarea name="article_text" style="width:400; height:200"></textarea>
...
editor_generate('article_text',config);
...
<script language="JavaScript">
var article_text, article_title, windowTitle, buttonText;
art_title = document.review.article_title.value;
art_text = editor_getHTML('article_text');
windowTitle = "Preview Article";
buttonText = "Close Window";
</script>
...
<input name="preview" type="button" value="{{preview_article_button}}" onClick="previewArticle(art_title, art_text, windowTitle, buttonText);">
...

The previewArticle is function which open new window and writes article title and article text in it. The problem is when calling function editor_getHTML - it doesn't returns any values!


esthera
User

Mar 21, 2004, 2:58 AM

Post #2 of 4 (2184 views)
Shortcut
Re: [impact] editor_getHTML help! Please! [In reply to] Can't Post

I am having the same problem of not getting any value with editor_getHTML(newsitem);.

Did you figure it out?


impact
New User

Mar 21, 2004, 8:55 AM

Post #3 of 4 (2178 views)
Shortcut
Re: [esthera] editor_getHTML help! Please! [In reply to] Can't Post

Yes! Here is code...


Code
 function previewArticle (title, text, windowTitle, buttonText) { 
var strHTML, metrika;

var screenWidth = screen.availWidth;
var screenHeight = screen.availHeight;
var windowWidth = 400;
var windowHeight = screenHeight - 100;

var positionLeft = screenWidth - windowWidth - 100;

metrika = "left=" + positionLeft + ",top=30,width=" + windowWidth + ", height=" + windowHeight + ", scrollbars=1,resizable=1";

strHTML = "<html>" +
"<head>" +
"<title>" + windowTitle + "</title>" +
"<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-2'>" +
"<link rel='stylesheet' href='style_w.css'>" +
"</head>" +
"<body leftMargin='10' rightMargin='10' topMargin='10' bottomMargin='10' marginHeight='10' marginWidth='10'>" +
"<table width='100%' height='100%' cellspacing='0' cellpadding='0' border='0' class='default'>" +
"<tr>" +
"<td align='left' valign='top'>" +
"<p class='title'>" + title + "</p>" + text +
"</td>" +
"</tr>" +
"<tr height='10%'>" +
"<td align='right' valign='bottom'>" +
"<input type='button' name='close' value='" + buttonText +"' onClick='JavaScript:window.close()'>" +
"</td>" +
"</tr>" +
"</table>" +
"</body>" +
"</html>";
preview = window.open("", "preview", metrika);
preview.document.open();
preview.focus();
preview.document.write(strHTML);
preview.document.close();
}


function doPreview (form) {

strTitle = form.article_title.value;
strText = editor_getHTML('article_text');
strWindowTitle = "Preview Article";
strButtonText = "Close Window";




previewArticle(strTitle, strText, strWindowTitle, strButtonText);
}


P.S. Put this code in top of your page...


cleany
Novice

Jan 10, 2005, 1:58 AM

Post #4 of 4 (1616 views)
Shortcut
Re: [impact] editor_getHTML help! Please! [In reply to] Can't Post

I get an error on this...

Parse error: parse error, unexpected T_STRING, expecting ')' in /opt/guide/www.tijdelijk.nl/lib/functions.php on line 81

this is the line :

function previewArticle(title, text, windowTitle, buttonText) {

 
 
 


Search for (options)