Welcome Guest, Not a member yet? Register   Sign In
Callback Validation with using two arrays for field names

In the view, I have several pairs of input fields like below
<input type="text" name="address[]" value="" />
<input type="text" name="type[]" value="" />

In the controller, I want to set up a callback validation like
$this->form_validation->set_rules('type[]', 'Address Type', 'callback_requireIfAssoicatedAddressIsFilled[address[]]');

Please advise on how I can code the callback validation, so type[0] is checked with only address[0] not the whole array when looping through the form_validation.excute()

Maybe something like this:
foreach ($type as $k => $v)
    $add_type = $v;
    $address = $address[$k];

I wish you people would quit using this forum topic for asking question! This forum topic is users that contribute libraries and other code for users.

The only question that should be asked in here are one that pertain to the libraries or code posted in here not genral questions.

Theme © iAndrew 2016 - Forum software by © MyBB