Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CKEDITOR post into a DIV

Posted on 2013-12-21
7
Medium Priority
?
411 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 54

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 54

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 54

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

Hire Technology Freelancers with Gigs

Work with 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

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…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

916 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