Use CKEditor for textareas in custom form I'm using the CKEditor module, and I would like to have the CKEditor in my custom textarea. I tried hard but it just doesn't work...

This some of the code I tried:

    $form['body'] = array (
        '#type' =&gt; 'textarea',
        '#title' =&gt; 'Item Snippet',
        '#default_value' =&gt; $body,
        '#cols' =&gt; 80,
        '#rows' =&gt; 7
    );
    $form['']['format'] = filter_form();
Use the text_format element type and CKEditor will catch your field:

  $form['body'] = array(
    '#type' =&gt; 'text_format',
    '#title' =&gt; t('Body'),
    '#format'=&gt; 'full_html',
  );


If you have issues with showing CKEditor in popup use additional #pre_render:

  $form['body'] = array(
    '#type' =&gt; 'text_format',
    '#title' =&gt; t('Body'),
    '#format'=&gt; 'full_html',
    '#pre_render' =&gt; array('ckeditor_pre_render_text_format'),
  );