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']);
}