Solved

CKEDITOR post into a DIV

Posted on 2013-12-21
7
395 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
  • 3
  • 3
7 Comments
 
LVL 52

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 52

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
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.

 

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 52

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 15

Accepted Solution

by:
myselfrandhawa 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
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 …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

20 Experts available now in Live!

Get 1:1 Help Now