2010-12-07 54 views
1

在Drupal中,在自定义模块的textarea中,如何以编程方式关闭tinymce编辑器(tinytinymce)?Drupal自定义模块,以编程方式关闭tinymce?

$form['subject'] = array(
    '#type' => 'textfield', 
    '#title' => t('Please Enter Subject'), 
    '#required' => TRUE, 
    '#weight' => 5, 
    '#description' => t('some description'), 
'#suffix' => 'a suffix', 
); 

回答

0

我使用以下注释。你应该能够适应你的表格。

function MYMODULE_form_alter (&$form, &$form_state, $form_id) 
{ 
     if ($form['#id'] == 'comment-form') { 
       $form['comment_filter']['format'] = array(); // nuke wysiwyg from comments 
     } 
} 
0

尝试

tinyMCE.execCommand('mceRemoveControl', false, editor_id); // the editor_id equals the id of your textarea 
+0

@Aalok堂:这不是评论,而是解决提问者的问题! – Thariama 2012-08-20 07:06:20