#5518 closed Bug (invalid)
Cannot embed a textarea in a form in ckeditor
| Reported by: | Chris Baker | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | 3.2 |
| Keywords: | Cc: |
Description
If I build a form using the toolbar in ckeditor and include a textarea in it then when you save and return to edit it sees the </textarea> as the tag used to define the initial CKEditor instance. Any content appearing after the textarea appears below the editor window.
Attachments (1)
Change History (14)
Changed 16 years ago by
| Attachment: | TesxtareBug.jpg added |
|---|
comment:1 Changed 16 years ago by
| Keywords: | textarea form removed |
|---|---|
| Priority: | High → Normal |
| Resolution: | → invalid |
| Status: | new → closed |
The HTML of your page is invalid as you aren't escaping the contents of the ckeditor textarea. You should use the PHP server integration to take care of it.
comment:2 Changed 16 years ago by
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
Where is this PHP Server Integration?
comment:3 Changed 16 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | reopened → closed |
Please, use our forums for general support.
You can find the integration and the samples in the contents of the zip that you downloaded.
comment:4 Changed 14 years ago by
This can be tricky.
Here's what I do:
// Javascript code:
function my_window_onload(){
ckeditor_abc = CKEDITOR.replace( "content", { toolbar: 'Page' } );
ckeditor_abc.on(
'instanceReady',
function(evt) {
this.setData(this.getData().replace(/safetextarea/g,'textarea'));
}
);
}
//php code
function draw_ckeditor($value){
$safe = str_replace('textarea','safetextarea',$value);
return
"<textarea id='abc' name='abc'>"
.$safe
."</textarea>";
}
Hope that helps somebody!
Blessings,
Martin Francis
http://www.ecclesiact.com
<><
comment:5 Changed 14 years ago by
Thank you for that approach. I searched that "error" for hours now. @alfonsoml: could you please point on the integration and the samples in the contents of the zip? @classaxe: Where do I have to insert the php code, please?
comment:6 follow-up: 7 Changed 14 years ago by
@Tobicic Have you tried - ckeditor\_samples\php?
Just look through what you have downloaded.
There is also CKEditor for Joomla and Drupal if you are interested - http://ckeditor.com/download, http://drupal.org/project/ckeditor
comment:7 Changed 14 years ago by
Replying to j.swiderski:
@Tobicic Have you tried - ckeditor\_samples\php?
Just look through what you have downloaded.There is also CKEditor for Joomla and Drupal if you are interested - http://ckeditor.com/download, http://drupal.org/project/ckeditor
Thank you for your quick reply. I read the _sample up and down. But I do not know what you mean and what I have to search for. Is it a problem to tell the filename and the linenumber and/or the syntax and where to integrate it?
comment:8 follow-up: 9 Changed 14 years ago by
Just donload CKEditor - http://ckeditor.com/download - and look through the downloaded zip.
If I remember correctly files for PHP end up with php extension.
Just look at ckeditor\_samples\php samples and see how CKEditor is implemented there.
comment:9 Changed 14 years ago by
Replying to j.swiderski:
Just donload CKEditor - http://ckeditor.com/download - and look through the downloaded zip.
If I remember correctly files for PHP end up with php extension.
Just look at ckeditor\_samples\php samples and see how CKEditor is implemented there.
Did you read the opening post "Cannot embed a textarea in a form in ckeditor"? The problem is not how to implement ckeditor (using a textarea, div or p), the problem is to include a textarea-formfield INSIDE the Editor because the inner /textarea closes the editor because it is not possible to nest a textarea inside a textarea like using DIVs.
comment:10 Changed 14 years ago by
Thank you Tobicic.
Tobicic is correct. THis is not about how to implement ckeditor.
the problem is when I place a text area on the page using the editor. Save that content and then try to reopen it.
comment:11 Changed 14 years ago by
I found the solution: http://cksource.com/forums/viewtopic.php?t=17605
comment:12 Changed 14 years ago by
Have you read the:
The HTML of your page is invalid as you aren't escaping the contents of the ckeditor textarea.
and actually tried to escape the contents?
comment:13 Changed 14 years ago by
I found the solution: http://cksource.com/forums/viewtopic.php?t=17605
Yes it was all about escaping.

This shows how my content is displayed when I edit it. THe submit buttons appear outside the editor!