Solved

CKEDITOR post into a DIV

Posted on 2013-12-21
7
402 Views
Last Modified: 2014-02-18
Hi,

I  try to post async a CKEDITOR form (ckeditor.com) into a div or CFDIV  (coldfusion)

Here is my code
<form>
<textarea name="editor1">someText</textarea>
<input type="submit">
</form>
		
		



<div name="result" id="result">
</div>

<script src="../ckeditor/ckeditor.js"></script>
<script>
	CKEDITOR.replace( 'editor1',

{
	toolbar: [
		{ name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview','Save'] },	// Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
		[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],			// Defines toolbar group without name.
			{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak', ] },		
																		// Line break - next group will be placed in new line.
		{ name: 'basicstyles', items: [ 'Bold', 'Italic' , 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
		{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
		
		
		
	]
});</script>

Open in new window


I try a lot of things but when i change value and post the form nothing change.

Thanks in advance.
0
Comment
Question by:quarkmike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39733932
I don't know CF, but when you are posting the data, remember, ck editor is just making your text area (<textarea name="editor1">someText</textarea>) pretty.

You still have to post the data someplace and then display it.  Either another page, the current page and accept the data via your server side code to a database, variable or cookie.
0
 

Author Comment

by:quarkmike
ID: 39734025
The issue is Ckeditor don't act like a classic textarea if i post asynch a classic textarea everything works fine but when i post a ckeditor textarea the data still the same and don't care about the modification i made.
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39734130
If you are posting async to another page and it works, that means it is working.  If you post normally and you don't see the extra html it creates, then something is wrong with your code that receives the data.  

To test, please create a page with a text area without ckeditor and post the data to the same page.  Make sure you have your cold fusion page set up to accept the post.  If that does not work, you know it is your own code.  If it does work, add back the code for ckeditor.  Just use the basic for now like
CKEDITOR.replace( 'editor1', {
    toolbar: 'Basic'
});

Open in new window

Now, submit again and what happens?  Select a work and make it bold and submit.  Do you see the extra code wrapped in strong or b?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:quarkmike
ID: 39734376
If i post normally (not async) everything works fine or don't work only if i post it async to a div. Using coldfusion.ajaxsubmit, or coldfusion.navigate or jquery.
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39735355
You can use jquery to post the async.  http://api.jquery.com/jQuery.post/  Look at the example $.post( "test.php", $( "#testform" ).serialize() );

That will post to the page test.php using the form with the id testform.
0
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 500 total points
ID: 39737478
please do not use cfdiv, it will create more problems rather than solution,

u want to post data from the cfeditor to div or div data to ckeditor, i am unclear of your questions, please confirm, so i can proceed with valid solution regards
0
 

Author Comment

by:quarkmike
ID: 39737486
I can use a div don't need a cfdiv if there is a solution to save data in file or dbase.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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