question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example of using textarea with Keditor

See original GitHub issue

Just stumbled across Keditor again and really like the way it is coming along, great job.

Currently using CKEditor in classroom project and have setup using textarea and some PHP to save the textarea content. I will note this is for learning in classroom only and we are not worried about security.

I had seen in closed issue that Keditor now support textareas. We have been struggling for hours attempting to get Keditor working with textarea and hoping for some input.

Our PHP looks like this:

` <?php

$filename = 'Data/test.inc';

if(file_exists($filename)){

	if(isset($_POST['write'])){

		$data = $_POST['content'];
		if($data != ''){
			$handle = fopen($filename, 'w') or die('Cannot open file:  '.$filename); 
			fwrite($handle, $data);
		} else 	{
			echo "This field must contain content...";
		}
	}
}
else{
	echo "ERROR!";
}
?>`

With save button like this:

<input class="btn btn-primary btn-lg raised" id="load" type="submit" name="write" id="write" value="SAVE" />

And textarea is:

<textarea style="width:100%;" class="input-block-level" name="content" id="editor1"><?php include Data/test.inc'; ?></textarea>

Any input will be greatly appreciated. Really like to start using Keditor simply because off the drag and drop.

Cheers!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
bradmaccommented, Dec 19, 2016

Thats our production code, but we dont have that in an example at the moment, sorry. I’ll try to knock one up over the holidays. Although all our examples are client side only so we probably wont have an actual server to use it with.

1reaction
bradmaccommented, Dec 17, 2016

Thanks! BTW, if you want to see it in action here’s a vid of using keditor with dynamic components - http://www.kademi.co/blogs/kb/building-customized-analytics-dashboards/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Saving Textarea Data - CKEditor 4 Documentation
A <textarea> element is replaced with classic editor using the CKEDITOR.replace() method.
Read more >
Add WYSIWYG HTML Editor to Textarea with CKEditor
CKEditor is the one of them to add a rich text editor to textarea. CKEditor is a WYSIWYG editor plugin that allows converting...
Read more >
Getting the textarea value of a ckeditor textarea with javascript
You asked about get value from textarea but in your example you are using a input. Anyways, here we go: $("#CampaignTitle").bind("keyup" ...
Read more >
Replace Textarea by Code — CKEditor Sample
This sample shows how to automatically replace all <textarea> elements with a CKEditor instance by using a JavaScript call. To replace a <textarea>...
Read more >
Add WYSIWYG HTML Editor to Textarea with CKEditor 5
Add WYSIWYG HTML editor to textarea Replace textarea element with WYSIWYG HTML editor using CKEditor plugin. Example code to add a text ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found