Welcome Guest, Not a member yet? Register   Sign In
TinyMCE_CodeIgniter , Internet Explorer problem
#1

[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">

&lt;? echo $content;?&gt;

</div> &lt;!-- end of container div --&gt;

&lt;/body&gt;
&lt;/html&gt;


Then I have a form view "news_add"


&lt;? echo form_open('news/news_add'); ?&gt;

<div id="form">
<table width="100%" align=center border="0" cellspacing="3" cellpadding="3">
<tr><td width="180"><B>Tytuł </B></td><td>&lt;?php echo form_input($news_title); ?&gt;</td></tr>
<tr><td width="180"><B>Treść</B></td><td>&lt;?php echo form_textarea($news_text); ?&gt;</td></tr>
<tr><td> </td><td>&lt;?php echo form_submit('submit', 'Zapisz'); ?&gt;</td></tr>
</table>
</div>
&lt;?php echo form_close(); ?&gt;



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>&lt;META HTTP-EQUIV="Refresh" CONTENT="1; URL='.site_url('news/news_all').'"&gt;';
}
$this->load->view('index', $this->response);


}




The problem is that in if I put "&lt;? echo form_open...?&gt;" 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
#2

[eluser]gtech[/eluser]
I havn't used TinyMCE before .. have you tried &lt;?php echo form_open..?&gt; or &lt;?=form_open....?&gt; instead of &lt;? echo form_open ?&gt; is it because you were using short tags... only a guess.

[url="http://ellislab.com/forums/viewthread/65061/"][link to thread 65061][/url] This thread has a link to a website that has an example of linking TinyMCE with codeigniter and it uses a form(see last reply) don't know if it will help you.




Theme © iAndrew 2016 - Forum software by © MyBB