Drupal 6 - Disable CK Editor wysiwyg programmatically

Submitted by Janak on Wed, 10/27/2010 - 11:42

Need to disable the CK Editor programmatically for specific form fields?

New form method

function mymodule_settings_form() {
  $form['foobar'] = array(
    '#type' => 'textarea', 
    '#title' => t('foobar'), 
    '#default_value' => "foobar", 
    '#required' => FALSE,
    '#wysiwyg' => FALSE,
  );
 
  return system_settings_form($form);
}

form alter method

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'mymodule_settings_form') {
    $form['foobar']['#wysiwyg'] = FALSE;
  } 
}