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

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

In the controller, I want to set up a callback validation like
Code:
$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()
#2

[eluser]pbflash[/eluser]
Maybe something like this:
Code:
foreach ($type as $k => $v)
}
    $add_type = $v;
    $address = $address[$k];
    
}
#3

[eluser]InsiteFX[/eluser]
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