Welcome Guest, Not a member yet? Register   Sign In
excuse my ignorance
#3

[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.


Messages In This Thread
excuse my ignorance - by El Forum - 03-04-2011, 11:42 AM
excuse my ignorance - by El Forum - 03-04-2011, 11:47 AM
excuse my ignorance - by El Forum - 03-04-2011, 01:03 PM
excuse my ignorance - by El Forum - 03-04-2011, 04:18 PM
excuse my ignorance - by El Forum - 03-04-2011, 04:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB