开发者

Drupal 6: Implement Wysiwyg on Custom Module Form

开发者 https://www.devze.com 2023-02-18 04:36 出处:网络
I ha开发者_运维百科ve a custom form that I have written with the Form API. We have the WYSIWYG module and TinyMCE implemented on the site that this module will be used on. How do I implement the WYSIW

I ha开发者_运维百科ve a custom form that I have written with the Form API. We have the WYSIWYG module and TinyMCE implemented on the site that this module will be used on. How do I implement the WYSIWYG api on my custom form text areas?

Thanks!


This should help integrate WYSIWYG with your custom module forms: http://drupal.org/node/358316

Basically, you need to add the format key to each of your form fields and use filter_form()


Just in case anybody working with Drupal 7, here's the link to it that should help integrate WYSIWYG TinyMCE with your custom form fields: http://drupal.org/node/1087468

Thanks


In case you are working in drupal 7. Use the following.

$form['FIELD'] = array(
  '#type' => 'text_format',
  '#title' => t('TITLE'),
  '#format' => 'full_html' //the format you used for editor.
);

In your form submit handler, you can access the value as follows.

$form_state['values']['FIELD']['value'];
0

精彩评论

暂无评论...
验证码 换一张
取 消