Welcome Guest, Not a member yet? Register   Sign In
Problems with form re-populating functions
#5

[eluser]CroNiX[/eluser]
[quote author="Galvão" date="1261309793"]Problem solved. Since I'm using form loading in one action and form submission in another I had to call the validation rules in the form loading action as well.

Two things are worth noticing, anyway:

1) The bug remains in the case of radio buttons, the last one is always checked, so I had to solve this "manually".
2) CI Team really should work on this, since it doesn't make sense to call validation rules upon loading the form.

Galvao[/quote]

In your controller why not check to see if the form was submitted before running validation?
Code:
if($this->input->post('submit'))  //assuming you have your submit button named "submit"
{
    if ($this->form_validation->run() == FALSE)
    {
        //failed
    }
    else
    {
        //passed...
    }
}
Then validation is only run if the form was submitted.


Messages In This Thread
Problems with form re-populating functions - by El Forum - 12-18-2009, 03:27 AM
Problems with form re-populating functions - by El Forum - 12-18-2009, 07:10 PM
Problems with form re-populating functions - by El Forum - 12-19-2009, 10:57 PM
Problems with form re-populating functions - by El Forum - 12-19-2009, 11:49 PM
Problems with form re-populating functions - by El Forum - 12-20-2009, 02:43 PM
Problems with form re-populating functions - by El Forum - 12-20-2009, 07:46 PM
Problems with form re-populating functions - by El Forum - 01-03-2010, 03:33 PM
Problems with form re-populating functions - by El Forum - 01-04-2010, 03:47 PM
Problems with form re-populating functions - by El Forum - 01-05-2010, 04:22 PM
Problems with form re-populating functions - by El Forum - 01-05-2010, 06:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB