I have form fields which are checkboxes as below :
<input id="abirrules@gmail.com" type="checkbox" checked="checked" value="abirrules@gmail.com" style="float:left;border:2px dotted #00f" name="email[]">
<input id="abirrules1@gmail.com" type="checkbox" checked="checked" value="abirrules1@gmail.com" style="float:left;border:2px dotted #00f" name="email[]">
<input id="abirrules3@gmail.com" type="checkbox" checked="checked" value="abirrules3@gmail.com" style="float:left;border:2px dotted #00f" name="email[]">
But when in the controller I am taking a var_dump($this->input->post(’email’)) , it displays bool(false) .
in the controller I have this method :
public function referral_email()
{
$data = $this->input->post('email');
var_dump($data);exit;
}
How to access this array of checkboxes in my controller ?
Are you by any chance trying to trim the output using the form validation library? I had the same problem, and removing ‘trim’ from the validation rules solved it.