How can i add WYSIWYG editor for my custom form textarea? I wrote a custom form module in that I placed one text area:

I've tried in this way:

$form['message'] = array(
  '#title' =&gt; t('Message'),
  '#type' =&gt; 'textarea',
  '#format' =&gt; 'full_html',
  '#default_value' =&gt; isset($ntemplates-&gt;message) ? $ntemplates-&gt;message : '',
  '#maxlength' =&gt; 255,
  '#attributes' =&gt; array(
  'class' =&gt; array('field_info'),
  'rows' =&gt; '5',
  'cols' =&gt; '200',
  ),
  '#wysiwyg' =&gt; TRUE,
);  


But it doesn't work. How can I integrate WYSIWYG editor in to my text area?

Note: I'm using wysiwyg-7.22 and ckeditor-3.6.6.2. In the basic page body section it's working. I wrote one custom module for form. In this I am unable to integrate wysiwyg editor.
Drupal 7 introduces the form element #type text_format, which is a text-format-enabled version of a textarea.

To integrate WYSIWYG into your custom form, just modify the attribute #type of form as:

'#type' =&gt; 'text_format'


Note: Tested it with CKEditor v 7.x.

In case if it doesn't work for you, please check your WYSIWYG configuration.

To hide format options, see: How to hide Input Format Options and help text under a textarea?

Above text field type works in Drupal 7 and 8.