[eluser]RobertB.[/eluser]
Thank you
The update part is working perfectly, the validation part i'm having problems
I'm getting this message 4 times because the array has 4 items
Code:
<p>The Price field is required.</p>
<p>The Price field is required.</p>
<p>The Price field is required.</p>
<p>The Price field is required.</p>
This is the code
Code:
function editPrices()
{
$this->load->library('form_validation');
$price = $this->input->post('price');
foreach ($price as $key => $value) {
$this->form_validation->set_rules('price['.$value.']', 'Price', 'trim|required|integer|xss_clean');
}
if ($this->form_validation->run() == false) {
echo validation_errors();
} else {
//$price = $this->input->post('price');
$this->selector->editPrice($price);
}
}
If I take the required part of the validation out everything works. Any ideas?
Thanks again.