4

I have an automatically generated text-area (by the Erlang Web framework) that looks like the following:

<span class="form_input">
  <textarea id="question_text" class="tinymce" name="question_text"> </textarea>
</span>

I'm trying to apply the TinyMCE editor to it, but what happens is the following:

http://img24.imageshack.us/img24/9250/tinyt.jpg

So, my textarea is not replaced, but it's "embedded" in the RTE. I'm initializing TinyMCE as follows:

<script type="text/javascript">
  tinyMCE.init({
    mode : "specific_textareas",
    editor_selector : "tinymce"
  });
</script>

Any hint?

GSto
  • 41,512
  • 37
  • 133
  • 184
Roberto Aloi
  • 30,570
  • 21
  • 75
  • 112
  • 1
    The code you've provided looks fine. Therefore, it must be something outside what you've shown us. Problems like these are hard to recreate on our part. As Chisum said, please try an provide a live example. You could try to recreate problem on http://jsbin.com and share the public link in your question. Otherwise we would all be shooting in the dark. – brianpeiris Oct 23 '09 at 23:48
  • Do you have multiple tinyMCE initializers set? Perhaps another tinyMCE.init() call is setting form_input as editor_selector. I'd look closely at all the JavaScript (use Firefox Web Developer toolbar > Information > View JavaScript) and check. – artlung Oct 30 '09 at 18:42
  • Can you provide the full HTML of the web page? – Nuno Maltez Nov 04 '09 at 10:56
  • @nunomaltez: unluckily, it's not online – Roberto Aloi Nov 04 '09 at 11:23
  • 1
    As a random guess, I'd try to replace "span" with "div". May be TinyMCE has problems inlining it's toolbar – Ivan Krechetov Nov 06 '09 at 08:42
  • @Ivan Krechetov: I tried, but it didn't help. Thanks anyway for the hint. – Roberto Aloi Nov 06 '09 at 09:57
  • Any luck with an example to determine more? –  Nov 12 '09 at 01:49

3 Answers3

2

try the following, cause I remember I did something similar and you have to specify the id of the textarea.

<script type="text/javascript">
   tinyMCE.init({
    mode : "exact",
    elements : "question_text"
  });
</script>
Anas Toumeh
  • 211
  • 1
  • 8
0

from screen shot it looks like one or many of the following might be an issue.

1) doctype and rendering of your html/css rules 2) your css rules might conflict 3) your html structure broken, DOM 4) tiny mc javascript may be having issues with dom structure, which in turn can be caused by doctype, html structure

is this issues page specific? or it happens on every page?

are your form elements inserted and created by js?

GnrlBzik
  • 3,358
  • 5
  • 27
  • 37
0

I tried to put a different #id from name attribute and it works

<textarea id="question_text" class="tinymce" name="question_text"> </textarea>

to

<textarea id="question_text_textarea" class="tinymce" name="question_text"> </textarea>

and then later...

tinymce.init({selector:'textarea'});
MCollard
  • 926
  • 2
  • 20
  • 39