Welcome Guest, Not a member yet? Register   Sign In
Using Arrays as Field Names
#14

[eluser]bkirkman[/eluser]
Since the above link is dead, here's the fix that worked for me. I take no credit. It was posted in the bug fix. This is what the set_value function should look like. It can be modified in the Form_validation library, but it is recommended to override it in the custom project library MY_Form_validation. Here goes.

Code:
function set_value($field = '', $default = '')
{
    if ( ! isset($this->_field_data[$field]))
    {
        return $default;
    }

    $field = &$this->_field_data[$field]['postdata'];

    if (is_array($field))
    {
        $current = each($field);
        return $current['value'];
    }

    return $field;
}

Hope this helps.


Messages In This Thread
Using Arrays as Field Names - by El Forum - 05-29-2010, 06:50 AM
Using Arrays as Field Names - by El Forum - 05-30-2010, 12:24 PM
Using Arrays as Field Names - by El Forum - 05-30-2010, 03:32 PM
Using Arrays as Field Names - by El Forum - 05-30-2010, 09:35 PM
Using Arrays as Field Names - by El Forum - 05-31-2010, 01:21 AM
Using Arrays as Field Names - by El Forum - 06-01-2010, 07:24 AM
Using Arrays as Field Names - by El Forum - 06-19-2010, 04:12 AM
Using Arrays as Field Names - by El Forum - 06-19-2010, 08:23 AM
Using Arrays as Field Names - by El Forum - 06-19-2010, 12:18 PM
Using Arrays as Field Names - by El Forum - 06-20-2010, 02:01 PM
Using Arrays as Field Names - by El Forum - 06-20-2010, 03:35 PM
Using Arrays as Field Names - by El Forum - 08-02-2010, 03:35 PM
Using Arrays as Field Names - by El Forum - 09-10-2010, 10:43 PM
Using Arrays as Field Names - by El Forum - 09-13-2010, 06:58 AM
Using Arrays as Field Names - by El Forum - 09-13-2010, 03:08 PM
Using Arrays as Field Names - by El Forum - 10-13-2010, 06:33 AM
Using Arrays as Field Names - by El Forum - 11-25-2010, 04:51 AM
Using Arrays as Field Names - by El Forum - 11-25-2010, 05:14 AM
Using Arrays as Field Names - by El Forum - 11-25-2010, 05:15 AM
Using Arrays as Field Names - by El Forum - 04-28-2011, 06:44 AM
Using Arrays as Field Names - by El Forum - 08-03-2011, 09:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB