07-01-2012, 08:42 AM
[eluser]cheungj[/eluser]
I know the documentation explains how to pass an array as the first parameter of set_rules(), and it explains how to pass a second parameter is when using a callback, but I'm stuck here.
Here is the code:
Basically, I want to pass two arrays into a custom function, for validation.
The callback is working fine.
The problem is that the <i>price_value</i> array is displaying as a string -- 'Array'.
It's not passing the actual array to the function, it only passes the string.
I'm just not sure how to ensure the array contents are passed to the function.
I'm posting because surely somebody has had to do this before?
Any help is appreciated.
I know the documentation explains how to pass an array as the first parameter of set_rules(), and it explains how to pass a second parameter is when using a callback, but I'm stuck here.
Here is the code:
Code:
$this->form_validation->set_rules('price_name[]', 'Price Name', 'callback_price_validation['
.$this->input->post('price_value').']');
Basically, I want to pass two arrays into a custom function, for validation.
The callback is working fine.
The problem is that the <i>price_value</i> array is displaying as a string -- 'Array'.
It's not passing the actual array to the function, it only passes the string.
I'm just not sure how to ensure the array contents are passed to the function.
I'm posting because surely somebody has had to do this before?
Any help is appreciated.