Welcome Guest, Not a member yet? Register   Sign In
Help with an form array
#1

[eluser]Unknown[/eluser]
I have a problem with retrieving array data from a form.

This is how the part of the form is generated:
Code:
foreach ( $roles as $role )
{
    echo '<p>'.$role->name.' '.form_checkbox($data = array('name' => 'roles[]', 'id' => 'roles'.$role->id, 'value' => $role->id, 'checked' => false)).'</p>';
}

I try to retrieve the array in the code as:
Code:
$rolesId=$this->input->post('roles');

But it is always null. In xdebug $_POST i can see that roles is an array and its values.

Any suggestions on how to get the data out?


Messages In This Thread
Help with an form array - by El Forum - 09-15-2010, 06:41 AM
Help with an form array - by El Forum - 09-15-2010, 07:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB