CKeditor and auto save with Coldfusion

Posted on 2014-08-03
Last Modified: 2014-08-05
Im trying to use CKeditor to make changes on a page, at the same time I would like it to autosave the information in to the database. I found this code online (uses FDKeditor) but when I add the Ckeditor, it does not replace the old FDKeditor. But what I would really like is to use the CKeditor inline feature if that is possible. Is there something Im missing with this code or Is there a code already out there that has the CKeditor inline feature?

		<script type="text/javascript">
			function autoSave(){
				ColdFusion.Ajax.submitForm("auto", "autoSaveAction.cfm", setSaveTime);
			function autoSaveEvery(ms) {
				var timeout=setTimeout("autoSave()",ms);
			function setSaveTime(res) {
				if (res) {
					document.getElementById('messageArea').innerHTML = 'Autosaved at ' + nowFormated();
			function nowFormated(){
				var now = new Date();
				var ampm = "AM";
				var hour = new Number(now.getHours());
				if (hour > 12) {
					ampm = "PM";
					hour = hour - 12;
				} else if (hour == 0) {
					hour = 12;
				var minutes = new Number(now.getMinutes());
				if (minutes <= 9) {
					minutes = "0" + minutes;
				var seconds = new Number(now.getSeconds());
				if (seconds <= 9) {
					seconds = "0" + seconds;
				return hour + ":" + minutes + ":" + seconds + " " + ampm;
<!--- Calls on the CKEditor --->
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<!--- /Calls on the CKEditor --->
	<body onLoad="autoSaveEvery(10000)">
<div id="messageArea"></div>
<cfform name="auto" id="auto">
<cftextarea richtext="true" 
<!--- toolbar="Basic" ---> 
<!---  CKeditor --->
<script type="text/javascript">
	CKEDITOR.replace( 'entry' );
<!--- / CKeditor --->

			<a href="autoSaveView.cfm?#createUUID()#" target="_blank">View Saved Data</a>

Open in new window

Question by:overcolor
    LVL 2

    Accepted Solution

    have you thought about using the ckEditor autosave plugin?

    all you need to do point it to your server-side script which'll handle the saving portion

    Author Comment

    I was looking create my own code because I will need to add this in other areas, I just needed a starting point.
    LVL 2

    Expert Comment

    by:c l
    why reinvent the wheel in this case whe there's already a plug-in that does what you want?

    Author Comment

    I was looking for something like this, Thank you

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
    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…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now