1

In a Drupal, on a textarea in a custom module, how can I turn tinymce editor (tinytinymce) off programatically?

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

2 Answers 2

0

I use the following for comments. You should be able to adapt for your form.

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

Try

tinyMCE.execCommand('mceRemoveControl', false, editor_id); // the editor_id equals the id of your textarea
1
  • @Aalok Parish: this is not a comment, but the solution to the askers problem!
    – Thariama
    Aug 20, 2012 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.