[eluser]Unknown[/eluser]
Thanks for the reply. Yes it doesn't make sense to call delete_preview twice. In an attempt to provide a concise example of my problem, I copied stuff, cut out what wasn't needed, and didn't notice. It would have made more sense to call it something like update_preview, but, I am not trying to make the button work correctly at this point. Sorry for the distraction.
The problem is with $content not being prepped the second time. Here is a complete working example that demonstrates my problem.
the controller
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Site extends Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
$data['content'] = "<p>\"</p>";
$this->load->view('test', $data);
}
}
the view
Code:
<?php
echo $content;
//$content = form_prep($content);
echo form_open('somewhere');
echo form_hidden('content', $content);
echo form_submit('submit', 'Update');
echo form_close();
echo form_open('somewhereelse');
echo form_hidden('content', $content);
echo form_submit('submit', 'Delete');
echo form_close();
?>
I have two (maybe more) solutions that work. Explicitly using form_prep() works, as does getting $content from the database instead of posting it. But each takes an extra step and should not be required according to the user guide. Thanks. Chris