[eluser]Unknown[/eluser]
Hi All,
I needed wysiwyg for my application, and decided to use TinyMce. However I found strange problem.
Structure is as follows.
First I have Index.php view where the header is loaded and content.
<html>
<head>
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</head>
<body>
<div id="container">
<? echo $content;?>
</div> <!-- end of container div -->
</body>
</html>
Then I have a form view "news_add"
<? echo form_open('news/news_add'); ?>
<div id="form">
<table width="100%" align=center border="0" cellspacing="3" cellpadding="3">
<tr><td width="180"><B>Tytuł </B></td><td><?php echo form_input($news_title); ?></td></tr>
<tr><td width="180"><B>Treść</B></td><td><?php echo form_textarea($news_text); ?></td></tr>
<tr><td> </td><td><?php echo form_submit('submit', 'Zapisz'); ?></td></tr>
</table>
</div>
<?php echo form_close(); ?>
and then I have controller which control it, so it puts a form into the content and then proceed it.
function news_add() {
$this->load->helper('tinymce');
$data['news_title'] = array('name' => 'news_title');
$data['news_text'] = array('name' => 'news_text','size'=>'40');
$rules['news_title'] = "required|xss_clean";
$this->validation->set_rules($rules);
if ($this->validation->run() == FALSE)
{
$this->response['content'] = $this->load->view('news/news_add', $data, True);
}
else
{
$this->load->model('newses');
$this->newses->add_news(array('news_title' => $this->input->post('news_title'),'news_text' => $this->input->post('news_text')));
$this->response['content'] = '<h1>Data recorded</h1><META HTTP-EQUIV="Refresh" CONTENT="1; URL='.site_url('news/news_all').'">';
}
$this->load->view('index', $this->response);
}
The problem is that in if I put "<? echo form_open...?>" in news_add view, than in Internet Explorer TinyMCE is not working (does not appear), (in Mozilla it works fine), and if I miss "echo" , than TinyMCE appears but, the form is not working (I can't submit that). Mozilla works fine.
I would be greatful for your ideas.
Regards
Bastek