Welcome Guest, Not a member yet? Register   Sign In
Reloading view form with data which was passed by controller view form, not form validation fields

Suppose this!...
board controller(board/bRead) loads a read view transferring with data[] fields..
and in the read view..there's a form section in the middle of read view file,
When the form submitted, it's called the controller&method;(board/commentPost) and reloading the same view file('read' view file)

Well, here's my problem!!!..

when the 'read' view file reloaded after the form submitted..
the data[] fields is disappeared because I didn't load the data[] field inside commentPost function...

You may ask "Why don't you define every data[] fields in the function..??",
but there's lots of data[] field to define..

Is there any method for 'commentPost() function' to receive every data[] field in the read view file loaded by the controller(board/bRead)?

class Board extends Controller{
   function bRead(){
   $data['aaa'] = 'this is aaaa data in read view';
   $data['bbb'] = 'bbb';
   ==> There's lots of $data[] fields..

   $this->load->view('read', $data);

   function commentPost(){
       //==> inserting database..

       error msg;;;



..blah blah
...blah blah
there are lots of data field from controller
   &lt;input type=text name='writer&gt;
   &lt;textarea name=comment&gt;&lt;/textarea&gt;
   &lt;input type=submit value='Submit'&gt;


[eluser]Michael Wales[/eluser]
Just redirect to the bRead function after your db insert.

What a simple!!!, just redirecting keep the previous data[] fields!!,,,
I was only thinking silly load->view()!!,

Thanks walesmd... for hitting my head!

Theme © iAndrew 2016 - Forum software by © MyBB