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:
display added text


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.

 


mtc38
New User

Jan 14, 2005, 4:24 PM

Post #1 of 1 (2199 views)
Shortcut
display added text Can't Post

Hi! I badly need help.

In addition to the user typing in text to the htmlarea, I have a button that adds some more text. I am able to retrieve whatever was added through the button but I do not know how to display that added text to the htmlarea. How do I do this?

Below is a snippet of my code:

==================================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>VITAL - Bin</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<script type="text/javascript" language="javascript">
_editor_url = "../admin/htmlarea/";
_editor_lang = "en";
</script>
<script language="javascript" type="text/javascript" src="../admin/htmlarea/htmlarea.js"></script>

<script type="text/javascript" language="javascript">

function submitStuff() {
document.AddToEssayForm.onsubmit();
document.AddToEssayForm.submit()
}
</script>
</head>
<body>
<form name="AddToEssayForm" method="post">
<input type="button" name="cbAddVideo" value="add" class="button" onClick="AddVideo()">
<a class="actionbutton" href="javascript:submitStuff()"> SUBMIT</a>
<textarea id="taEssay" name="taEssay" rows="15" cols="50"></textarea>
</form>

<script type="text/javascript">
var config = new HTMLArea.Config();
config.editorURL = '/htmlarea/';

var mytext = '';
var essayEditor = new HTMLArea("taEssay", config);
essayEditor.generate();

function AddVideo() {
essayEditor._textArea.value =essayEditor.getHTML();
var token = " my choice";
essayEditor._textArea.value += token;
mytext = essayEditor._textArea.value;
document.AddToEssayForm.taEssay.value = mytext;
essayEditor.setHTML(mytext);
}
/script>
</body>
</html>

=======================================================

Basically, when the user clicks on the add button, the function "AddVideo" assigns to "mytext" all the text within the htmlarea and the text added through the add button. I want to display everything in "mytext" into the htmlarea for the user to view.

Also, I would appreciate suggestions of a better way to implement this.

Thanks!

Min Unsure

 
 
 


Search for (options)