Welcome Guest, Not a member yet? Register   Sign In
Form Validation: Using Arrays as Field Names in 2.0
#4

[eluser]jarnold[/eluser]
It ended up being too much trouble to replace clean code like this with a bunch of loops:

$data['aliases'] = $this->form_validation->set_value('alias[]', $saved_aliases);
$data['parents'] = $this->form_validation->set_value('parent[]', $saved_parents);
$data['number_names'] = $this->form_validation->set_value('number_name[]', $saved_number_names);
$data['number_phones'] = $this->form_validation->set_value('number_phone[]', $saved_number_phones);
$data['editors'] = $this->form_validation->set_value('editor[]', $saved_editors);

So I ended up just creating a MY_Form_validation extending the CI one and overriding set_value() with the old logic.


Messages In This Thread
Form Validation: Using Arrays as Field Names in 2.0 - by El Forum - 02-03-2011, 12:03 PM
Form Validation: Using Arrays as Field Names in 2.0 - by El Forum - 02-03-2011, 01:42 PM
Form Validation: Using Arrays as Field Names in 2.0 - by El Forum - 02-25-2011, 09:40 AM
Form Validation: Using Arrays as Field Names in 2.0 - by El Forum - 02-25-2011, 11:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB