Solved

Free RTE ( http://freerichtexteditor.com/ ) . Problem preloading content.

Posted on 2008-10-29
1
1,785 Views
Last Modified: 2012-06-27
Hello Experts,

I am new to ASP and relatively new to JS, so I apologize for this silly question.

I have a problem preloading content to  Free Rich Text Editor( http://freerichtexteditor.com/ ).
I included all the requires files to my ASP page:

<script LANGUAGE="javascript" type="text/javascript" src="/Includes/JS/config.js"></script>
<script LANGUAGE="javascript" type="text/javascript" SRC="/Includes/JS/richtext.js"></script>

and initialized RTE in my <table></table> successfully:

<SCRIPT LANGUAGE=javascript>
initRTE(' ', ' ');
</SCRIPT>

Now I need to preload some content there. I have a variable on my page which is basically a value from the DB, which is generated dynamically and I can' hardcode it. The value of this variable is supposed to preload in the textarea of RTE.

I tried to initialize RTE like this, first parameter is supposed to be preloaded content.

<SCRIPT LANGUAGE=javascript>
initRTE('<%=myVariable%> ', ' ');
</SCRIPT>

But it didn't work.

At the same tme  initRTE('some text ', ' '); works just fine.

I came across the following example for ASP:

http://mrcmain.net/Smitha/RTE/examples/example.asp

Can someone help me to make it work with VB6?

Thanks in advance.

0
Comment
Question by:snarinsky
1 Comment
 
LVL 7

Accepted Solution

by:
bluV11t earned 500 total points
ID: 22838974
Hi!
I think you just have to do some small syntax changes to freeRTE_Preload function to make it VB.
<%
function freeRTE_Preload(content)
	' Strip whitespace.
	content = trim(content);
	' Strip newline characters.
	content = replace(content, chr(10), " ")
	content = replace(content, chr(13), " ")
	' Replace single quotes.
	content = replace(content, chr(145), chr(39))
	content = replace(content, chr(146), chr(39))
	' Return the result.
	freeRTE_Preload = content
End function
' Send the preloaded content to the function.
myVariable = freeRTE_Preload("<i>This is some <b>preloaded</b> content</i>")
 
%>

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question