Welcome Guest, Not a member yet? Register   Sign In
Bug with Form Validation Class? -- Only those fields that have set rules can be re-populated after form validation faile
#1

[eluser]Eason[/eluser]
EDIT: just known some one have posted similar question. Sorry for that. The earlier post is here:
http://codeigniter.com/bug_tracker/bug/7300/

I do not know if it is a bug or a deliberate behavior. Here is the situation.

There are two input boxes named “username” and “description”. I set a rule for “username” but no rule for “description” with codes below.

Code:
$config =
array(
        array(
            'field' => 'username',
            'label' => 'Username',
            'rules' => 'required|min_length[6]|max_length[20]'
        )
);

When I type only one letter in the field “username” and several letters in field “description”, and then submit the form, the form validation will fail surely, saying that “The Username field must be at least 6 characters in length”. At this moment, the field “username” is re-populated with the previous input letter, but the field “description” is blank – the previous input letters has gone.




Theme © iAndrew 2016 - Forum software by © MyBB