Welcome Guest, Not a member yet? Register   Sign In
Repopulating form after validation with set_value()?


I have run into a problem while repopulating a form after validation.

Here is my view file:
<?=form_input("title", set_value("title"))?>
<?=form_textarea("content", set_value("content"))?>
<?=form_submit('submit', 'OK')

Here is my controller:
function add(){
    $this->form_validation->set_rules('title', 'Title', 'required|min_length[4]');
      $this->template->load("frame", "notebook/add");
  } else {
    $this->template->load("frame", "notebook/add");

Now the problem is that the textarea (content) field isnt being repopulated.
If i do a var_dump($_POST) in the beginning of my view file then both title and content exist but if i do a var_dump(set_value("content")) then nothing is there.

Any thought on that? Thanks.

Here i go again. Making a pointless thread without using google proprely! Smile

Turnes out this is actually an "unconfirmed bug", here is a solution http://ellislab.com/forums/viewthread/96617/P15/#689642.
Interesting that after all this time the bug still hasnt been fixed Tongue

Theme © iAndrew 2016 - Forum software by © MyBB