Example of using textarea with Keditor
See original GitHub issueJust 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:
- Created 7 years ago
- Reactions:1
- Comments:18 (9 by maintainers)
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.
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/