[eluser]kaejiavo[/eluser]
Hi,
i have a problem validating an array field.
Code:
$this->form_validation->set_rules('qty[]', 'quantity', 'required');
foreach ($items as $item) {
// input field qty[]
$quantity = array(
'name' => "qty[{$item->id}]",
'id' => 'quantity',
'value' => set_value("qty[{$item->id}]"),
'maxlength' => '5',
'size' => '5',
'style' => '',
);
$this->data['form']['quantity'][$item->id] = form_input($quantity);
}
I get the form fields and the POST array as desired.
Code:
$_POST['qty']
Array
(
[3] => 4
[1] =>
)
My Problem is that it will validate only if _all_ array values are set. I need only at least 1 value set for the application.
Has someone a clue for me how to validate this?
TIA
Marco