[eluser]Unknown[/eluser]
I started doing something similar today and ran into a problem,
To get the validation library to see the fields do this:
Code:
$this->load->library('validation');
foreach($_POST['field'] as $k => $v)
{
$rules["field[$k]"] = "required";
$fields["field[$k]"] = "Field #".$i++;
}
$this->validation->set_rules($rules);
$this->validation->set_fields($fields);
$this->validation->set_message('required', "%s is required");
The only problem now is even if there is a value in the field, it gets ignored and the set message does not work either...
Also, the set_fields and set_message is not required