Development

#554 (textarea_tag causes W3C invalid page with TinyMCE)

You must first sign up to be able to contribute.

Ticket #554 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

textarea_tag causes W3C invalid page with TinyMCE

Reported by: hardrock Assigned to:
Priority: minor Milestone: 0.6.3
Component: Version:
Keywords: Cc:
Qualification:

Description

When a richtext textarea using TinyMCE is included, the tinymce_options parameter for the textarea_tag is not only added to the TinyMCE init javascript, but also to the textarea tag. This causes W3C invalid HTML code, since the property tinymce_options doesn't exist.

Symfony code:

<?php echo textarea_tag('text', '', array(
  'rich'		=> true,
  'tinymce_options'     => 'theme:"simple", content_css:"/css/tinymce.css"',
)) ?>

causes HTML code:

<script type="text/javascript">
//<![CDATA[

tinyMCE.init({
  mode: "exact",
  language: "en",
  elements: "text",
  plugins: "table,advimage,advlink,flash",
  theme: "advanced",
  theme_advanced_toolbar_location: "top",
  theme_advanced_toolbar_align: "left",
  theme_advanced_path_location: "bottom",
  theme_advanced_buttons1: "justifyleft,justifycenter,justifyright,justifyfull,separator,bold,italic,strikethrough,separator,sub,sup,separator,charmap",
  theme_advanced_buttons2: "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,image,flash,separator,cleanup,removeformat,separator,code",
  theme_advanced_buttons3: "tablecontrols",
  extended_valid_elements: "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
  relative_urls: false,
  debug: false
  
  ,theme:"simple", content_css:"/css/tinymce.css"
});
//]]>
</script>
<textarea name="text" id="text" class="comment" tinymce_options="theme:"simple", content_css:"/css/tinymce.css""></textarea>

This bug can be easily fixed by unsetting the tinymce_options in the FormHelper?.php after adding it to the TinyMCE init after line 300.

    if(isset($options['tinymce_options']))
    {
      unset($options['tinymce_options']);
    }

Change History

06/16/06 16:08:20 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 0.6.3.

in r1462