• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

CKeditor and auto save with Coldfusion

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

  • 2
  • 2
1 Solution
c lCommented:
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
overcolorAuthor Commented:
I was looking create my own code because I will need to add this in other areas, I just needed a starting point.
c lCommented:
why reinvent the wheel in this case whe there's already a plug-in that does what you want?
overcolorAuthor Commented:
I was looking for something like this, Thank you

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now