Forums
This topic is locked
Minor ASP Syntax help needed
Posted 26 Jun 2006 05:21:33
1
has voted
26 Jun 2006 05:21:33 Zain Magsi posted:
I have a WYSIWYG text area editor on a CMS page that works well with dynamic content plugged into it from the database as long as the content/text has no quotes or HTML markup. What I want to do is (and not succeeding) is to get it to work with text that has line breaks, some markup etc in it. I think it has some thing to do with syntax mistakes on my part (I.e. using """ and such improperly). Look for this code below "sContent = "here's the " & chr(13) & """preloaded <b>content</b>""""
I want to put a <%=(rsContent.Fields.Item("Content"

Below is the portion of the code where the db content is plugged in:
<form name="RTEDemo" action="demo.asp" method="post" onSubmit="return submitForm();">
<script language="JavaScript" type="text/javascript">
<!--
<%
sContent = "here's the " & chr(13) & """preloaded <b>content</b>"""
sContent = RTESafe(sContent)
%>//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', '<%=sContent%>', 520, 200, true, false);
//-->
</script>
<p>Click submit to show the value of the text box.</p>
<p><input type="submit" name="submit" value="Submit"></p>
</form>
Your help will be very appreciated
Zain<b></b><b></b>