1

I am trying to create a form with the Drupal 5 form API that has two textareas, both of which should have have a wysiwyg editor enabled to allow HTML formatted input. However, only the second textarea has the editor enabled, the other one displays the "Input format selector", but not the editor controls. I have tried this with TinyMCE 3.3.9.3 and 3.3.9.4b and CKEditor 3.5.1.6398 both using the wysiwyg module integration, the result in both cases is the same.

In this related question it is mentioned that there might be a problem of identical IDs. I have no clue how to transfer this solution to the Drupal Form API, since I gave the two fields different names. In the generated HTML, they have separate HTML ids based on the Drupal names I assigned.

The code I used to create the text areas is the following:

$form['oos'] = array(
    '#tree' => false,
);

$form['oos']['oosmessage'] = array(
    '#description' => t('Something'),
    '#title' => t('Generic out of stock message'),
    '#type' => 'textarea',
);

$form['oos']['format'] = filter_form(1, 20, array('format'));

$form['oosmd'] = array(
    '#tree' => false,
);

$form['oosmd']['oosmessage_date'] = array(
    '#type' => 'textarea',
    '#title' => t('Out of stock message until a specific date'),
    '#description' =>t('Something else.'),
);
$form['oosmd']['format'] = filter_form(1, 20, array('format'));

Thanks!

Ellen

divibisan
  • 11,659
  • 11
  • 40
  • 58
Ellen
  • 33
  • 6

1 Answers1

0

Try to give the two textareas different ids and see if that works.

Thariama
  • 50,002
  • 13
  • 138
  • 166
  • Thanks. As far as I can tell, the two textareas already have different ids. Could you suggest what to change? – Ellen Feb 02 '11 at 09:52
  • Hmm, i am not that much into Drupal myself. Could you please post what "tinymce.editors[0].id" and "tinymce.editors[1].id" yield when used int he firebug console? – Thariama Feb 02 '11 at 10:58
  • They are both defined, but tinymce.editors is an empty array. – Ellen Feb 02 '11 at 13:44
  • This is pretty wierd because the editorinstances are usually to be found inside tinymce.editors. which version are you using? – Thariama Feb 02 '11 at 14:28
  • This is a beta release! I strongyl suggest you try the latest production release 3.3.9.3. – Thariama Feb 03 '11 at 09:51
  • Thanks, I did. But it does not change anything.= – Ellen Feb 03 '11 at 10:25
  • As I mentioned in my edit to the question, I just tried substituting CKeditor for Tinymce and the result is the same. – Ellen Feb 03 '11 at 10:32
  • hmm, i do not know how a replacement in drupal needs to be done – Thariama Feb 03 '11 at 10:36