Welcome Guest, Not a member yet? Register   Sign In
Multiple entry update and delete form
#9

[eluser]jpidgeon[/eluser]
I've done a check and double quotes only appear to be needed there in the controller.

It just doesn't look like the $team variable is being set. I've used print_r to check:

Code:
function manage_team()
    {
        if ($this->input->post('team_id'))
        {
            foreach ($this->input->post('team_id') as $index => $id)
            {  
                if ($this->input->post('delete'))
                {
                    $this->admin_model->delete_team($id);
                }
                else if ($this->input->post('update'))
                {
                    $team = array();
                    $team['team_name'] = $this->input->post("team_name[$index]");
                    $team['owner1'] = $this->input->post("owner1[$index]");
                    $team['owner2'] = $this->input->post("owner2[$index]");
                    $team['owner3'] = $this->input->post("owner3[$index]");
                    
                    print_r($team);
                    //$this->admin_model->update_team($id, $team);
                }
            }
        }
        //redirect('/admin/teams', 'refresh');
    }

and just get:

Quote:Array ( [team_name] => [owner1] => [owner2] => [owner3] => )

Both $id and $index are being set fine but the post field values are not being grabbed. I've checked again on my view and all the field names are correct.


Messages In This Thread
Multiple entry update and delete form - by El Forum - 11-28-2010, 08:40 AM
Multiple entry update and delete form - by El Forum - 11-28-2010, 12:04 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 06:54 AM
Multiple entry update and delete form - by El Forum - 11-29-2010, 07:53 AM
Multiple entry update and delete form - by El Forum - 11-29-2010, 08:31 AM
Multiple entry update and delete form - by El Forum - 11-29-2010, 12:04 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 01:04 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 03:21 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 04:17 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 04:29 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 04:33 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 04:39 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 04:54 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 05:02 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 05:10 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 05:22 PM
Multiple entry update and delete form - by El Forum - 11-29-2010, 05:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB