Welcome Guest, Not a member yet? Register   Sign In
Is this a CI 1.7 Form validation Helper BUG?
#1

[eluser]mindprojects[/eluser]
All right guys,i'm not pretty sure,but using the new form validation functions(eg. set_select)something changed from previous version(1.6.3) and i'm not sure if it's a small bug.
What i was doing to repopulate from select boxes in 1.7,while using pagination was :

1) set form data in POST values(eg $_POST['select name'] = selected value
2) set $this->validation->set_select('form_name','option value') into the select element;

This trick was working till 1.6.3 release,as it should be,but bothing to do with the new 1.7 set_select.

Then i discovered the problem:
This is the code from form_helper
Code:
function set_select($field = '', $value = '', $default = FALSE)
    {
        $OBJ =& _get_validation_object();


        if ($OBJ === FALSE)
        {
            if ( ! isset($_POST[$field]))
            {
                if (count($_POST) === 0)
                {
                    return ' selected="selected"';
                }
                return '';
            }

I simply changed this into this:
Code:
function set_select($field = '', $value = '', $default = FALSE)
    {
        $OBJ =& _get_validation_object();


        if ($OBJ)
        {
            if ( ! isset($_POST[$field]))
            {
                if (count($_POST) === 0)
                {
                    return ' selected="selected"';
                }
                return '';
            }

I would like someone to reply for this,
thanks
Marco


Messages In This Thread
Is this a CI 1.7 Form validation Helper BUG? - by El Forum - 11-26-2008, 07:58 AM
Is this a CI 1.7 Form validation Helper BUG? - by El Forum - 01-03-2009, 11:15 PM
Is this a CI 1.7 Form validation Helper BUG? - by El Forum - 03-23-2009, 10:42 AM
Is this a CI 1.7 Form validation Helper BUG? - by El Forum - 03-23-2009, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB