Solved

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

Posted on 2008-10-29
1
1,780 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

785 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