Click to See Complete Forum and Search --> : javascript rich text editor shows html tags in ASP text area


karen987
04-08-2007, 02:30 AM
My newsweblog has ASP pages with news articles and a commenting system. The comments are posted, and to read them the reader clicks on the headline of the comment, and it opens up in a pop up window.

I added this "whizzywig rich text editor" to the comments textbox where readers comment on articles.
Whizzywig is a javascript rich text editor, and appears to work fine. I type the comment using the editor when i need to and then click submit.

However, when i open the comments to read them, the formatting doesn't show, instead there are tags and html in the comment box.

How do i correct this? or does anyone know a simple ASP rich text editor?

Here is the code below, do i need to add something to it? Any help appreciated, and i'm not html or ASP literate, Thank you




<table align="center" width="400" cellpadding="2" cellspacing="0" border="0">
<form action="_comments.asp?ID=<%=NID%>" method="post" name="frm3" onSubmit="return ValidateComment()">
<tr>
<td width="100">Name</td>
<td width="300"><%=Session("PMMS_USERNAME")%></td>
</tr><tr>
<td>Country</td>
<td width="300"><%=Session("PMMS_COUNTRY")%></td>
</tr><tr>
<td>Subject*</td>
<td width="300"><input type="Text" name="subject" value="" maxlength="50" class="textbox" style="width: 100%"></td>
</tr><tr>



<td valign="top">Comment*</td>
<td width="300"><textarea id="comment" rows="6" cols="50" name="comment" style="width: 100%;" class="textbox"></textarea>

<script type="text/javascript">
buttonPath = "buttons/";
makeWhizzyWig("comment", "formatblock fontsize rule newline color hilite bold italic underline number bullet undo redo");
</script>



<input type="Checkbox" name="allowE" value="1" />Allow readers to email me.
</td>
</tr><tr>
<td></td>
<td><input type="Submit" value="Leave Comment" /></td>
</tr>
<input type="Hidden" name="mode" value="set" /></form>
</table>

buntine
04-08-2007, 08:42 AM
Ok, first step, become ASP and HTML literate!

David Roth has a great RTE (rich text editor) available on his Website. Just Google his name and I am sure you will find it. I have used and modified it for years.

Anyway, when you say "comment box" are you referring to an HTML division (<div>) or table (<table>) element or a text area (<textarea>) element? If it is the latter, it is important that you know what no HTML formatting will be displayed in a textarea. Only raw text can be displayed. You will need to load the data back into the rich text editor.

Cheers,
Andrew Buntine.

karen987
04-08-2007, 02:47 PM
Ok, first step, become ASP and HTML literate!

David Roth has a great RTE (rich text editor) available on his Website. Just Google his name and I am sure you will find it. I have used and modified it for years.

Anyway, when you say "comment box" are you referring to an HTML division (<div>) or table (<table>) element or a text area (<textarea>) element? If it is the latter, it is important that you know what no HTML formatting will be displayed in a textarea. Only raw text can be displayed. You will need to load the data back into the rich text editor.

Cheers,
Andrew Buntine.

Thank you Andrew,

The comment box, is as in the code above, i think it is a textarea. So how do i load it back into a text editor?

buntine
04-08-2007, 10:50 PM
Each editor will handle this differently (most likely slightly, albeit). I would consult the documentation for this particular editor.

Cheers,
Andrew Buntine.