我想在我的CMS上编辑表单,我正在使用最新的Tinymce编辑器。问题: 我正在向textarea回应数据,但编辑器是空的。我在firebug中查看隐藏的textarea数据是加载程序,但不是在编辑器中,而是仅在firefox上。
请帮助。
代码示例。
<!-- place in header of your html document -->
<script>
tinymce.init({
selector: "textarea#body",
theme: "modern",
language : "lt",
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor jbimages"
],
content_css: "<?php echo base_url();?>assets/admin/js/tinymce/skins/lightgray/content.min.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | l ink image jbimages | print preview media fullpage | forecolor backcolor",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
],
relative_urls: false
});
</script>
<div class="add_edit_content">
<?php echo form_open('admin/pages/edit/'.$page->id); ?>
<div class="f_content">
<table>
<tbody>
<tr>
<td class="name">
<label for="name">Pavadinimas:</label>
</td>
<td class="val">
<input id="name" type="text" name="name" placeholder="Pavadinimas" value="<?php echo $page->name;?>" />
</td>
</tr>
<tr>
<td class="name">
<label for="alias">Adresas:</label>
</td>
<td class="val">
<input id="alias" type="text" name="alias" placeholder="/puslapis" value="<?php echo $page->alias;?>" />
</td>
</tr>
<tr>
<td class="name">
<label for="body">Turinys:</label>
</td>
<td class="val">
<textarea rows="20" id="body" name="body"><?php echo $page->body;?></textarea>
</td>
</tr>
<tr>
<td class="name">
<label for="published">Publikuoti:</label>
</td>
<td class="val">
<label>
<input type="radio" name="published" <?php if ($page->published == 1) { echo 'checked="checked"';} ?> value="1"><b>Taip</b>
</label>
<label>
<input type="radio" name="published" <?php if ($page->published == 0) { echo 'checked="checked"';} ?> value="0"><b>Ne</b>
</label>
</td>
</tr>
<tr>
<td class="name">
</td>
<td class="val">
<input type="submit" value="Saugoti" name="submit" />
</td>
</tr>
</tbody>
</table>
</div>
<?php echo form_close(); ?>
</div>