Welcome Guest, Not a member yet? Register   Sign In
Small issue with form_validation
#1

[eluser]Treeda[/eluser]
Hi there,

i just stumbled over a small issue with having the rules in a config file.

i wondered why only 1 rule was applied to my form instead of the other 4 in the config file.
It seems if you add rules manually this won't get merged with the rules existing in the form_validation.php config file.

I know i could workaround it but i would love if i could set a common ruleset and simply add or overwrite rules in the case i need.

regards
Treeda
#2

[eluser]Treeda[/eluser]
heres an example what i meant, now i do it this way:

Code:
//first load and set the rules from config
$this->form_validation->set_rules($this->form_validation->_config_rules);

//then its safe to add manually rules without kicking the config file rules
$this->form_validation->set_rules('login', 'Benutzername', 'trim|required|min_length[6]|max_length[25]|callback_check_username|xss_clean');
$this->form_validation->set_rules('captcha', 'Code', 'trim|required|callback_check_CAPTCHA');




Theme © iAndrew 2016 - Forum software by © MyBB