Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#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)

TesxtareBug.jpg (177.4 KB) - added by Chris Baker 9 years ago.
This shows how my content is displayed when I edit it. THe submit buttons appear outside the editor!

Download all attachments as: .zip

Change History (14)

Changed 9 years ago by Chris Baker

Attachment: TesxtareBug.jpg added

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

comment:1 Changed 9 years ago by Alfonso Martínez de Lizarrondo

Keywords: textarea form removed
Priority: HighNormal
Resolution: invalid
Status: newclosed

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 9 years ago by Chris Baker

Resolution: invalid
Status: closedreopened

Where is this PHP Server Integration?

comment:3 Changed 9 years ago by Alfonso Martínez de Lizarrondo

Resolution: invalid
Status: reopenedclosed

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 8 years ago by classaxe


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

Last edited 8 years ago by classaxe (previous) (diff)

comment:5 Changed 7 years ago by Ursula

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 Changed 7 years ago by Jakub Ś

@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 in reply to:  6 Changed 7 years ago by Ursula

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? And if there is a solution, why isn't it already fixed in a new version of ckeditor because any Firefox-user has that problem if he/she wants to integrate a textarea inside ckfinder?

Last edited 7 years ago by Ursula (previous) (diff)

comment:8 Changed 7 years ago by Jakub Ś

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 in reply to:  8 Changed 7 years ago by Ursula

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 7 years ago by Chris Baker

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:12 Changed 7 years ago by Jakub Ś

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 7 years ago by Jakub Ś

I found the solution: http://cksource.com/forums/viewtopic.php?t=17605

Yes it was all about escaping.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy