Welcome Guest, Not a member yet? Register   Sign In
checkbox array
#1

[eluser]DIG[/eluser]
Forgive me for my very bad English.

I have read many of the forum on the arrays and checkbox, but bash can not solve a simple task.

In my view:
Code:
<input name="test[1]" type="checkbox" value="1">
<input name="test[2]" type="checkbox" value="1">
<?=$this->validation->test_error; ?>

In my controller:
Code:
$rules['test'] = "callback_";
$this->validation->set_rules($rules);

$fields['test']    = '"test checkbox"';
$this->validation->set_fields($fields);

function test_check()
{
  if(isset($_POST['test'])){
    $this->validation->set_message('test_error', 'Checked!');
    return TRUE;
  }else{
    $this->validation->set_message('test_error', 'Not Checked!');
    return FALSE;
    }
}
if ($this->validation->run() == FALSE){
...redisplay form...
This is the trouble place.
no message displayed.

}else{
...insert in db, redirect...
}

where I am wrong? or I am hopelessly stupid? Smile
Thanks.


Messages In This Thread
checkbox array - by El Forum - 08-31-2007, 12:51 PM
checkbox array - by El Forum - 08-31-2007, 01:24 PM
checkbox array - by El Forum - 08-31-2007, 01:33 PM
checkbox array - by El Forum - 08-31-2007, 01:52 PM
checkbox array - by El Forum - 08-31-2007, 02:32 PM
checkbox array - by El Forum - 08-31-2007, 04:19 PM
checkbox array - by El Forum - 08-31-2007, 04:21 PM
checkbox array - by El Forum - 08-31-2007, 04:38 PM
checkbox array - by El Forum - 08-31-2007, 10:49 PM
checkbox array - by El Forum - 09-01-2007, 04:38 AM
checkbox array - by El Forum - 09-01-2007, 06:31 AM
checkbox array - by El Forum - 09-06-2007, 01:34 PM
checkbox array - by El Forum - 09-06-2007, 03:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB