Welcome Guest, Not a member yet? Register   Sign In
Population of checkbox arrays in Validation library
#5

[eluser]WeeJames[/eluser]
Was getting the same as jeffery04. Fixed it by doing the following in Validation.php

Code:
function set_checkbox($field = '', $value = '')
    {
        if ($field == '' OR $value == '' OR  ! isset($_POST[$field]))
        {
            return '';
        }
        if ($_POST[$field] == $value || (is_array($_POST[$field]) && in_array($value, $_POST[$field]) ) )
        {
            return ' checked="checked"';
        }
    }

and

Code:
function prep_for_form($data = '')
    {
        if (is_array($data))
        {
            foreach ($data as $key => $val)
            {
                $data[$key] = $this->prep_for_form($val);
            }
            
            return $data;
        }
        
        if ($this->_safe_form_data == FALSE OR $data == '')
        {
            return $data;
        }

        return str_replace(array("'", '"', '<', '>'), array("'", "&quot;", '&lt;', '&gt;'), stripslashes($data));
    }


Messages In This Thread
Population of checkbox arrays in Validation library - by El Forum - 01-26-2008, 10:43 AM
Population of checkbox arrays in Validation library - by El Forum - 02-07-2008, 01:11 PM
Population of checkbox arrays in Validation library - by El Forum - 02-07-2008, 02:24 PM
Population of checkbox arrays in Validation library - by El Forum - 04-16-2008, 10:08 PM
Population of checkbox arrays in Validation library - by El Forum - 04-17-2008, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB