Use CKEditor for textareas in custom 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'),
  );