Problems with Form validation |
[eluser]fireproofsocks[/eluser]
I moved my form validation rules to a config file as outlined here: http://ellislab.com/codeigniter/user-gui...ation.html But as soon as I did that, the form never validates and no errors are shown. The forms were working before. Anybody got ideas of what I can check? I'm using my own custom validation rules in libraries/MY_Form_validation.php My Controller: Code: // Display the advanced search form My config file (config/form_validation.php): Code: $config = array(
[eluser]InsiteFX[/eluser]
Hi everettg_99, Not sure if this will help, but I think the problem is that your useinng a extended for_validation. Try name your config file the same as your MY_Form_validation.php and see if it will load. Enjoy InsiteFX
[eluser]fireproofsocks[/eluser]
AHA! The config file DOES have to be named form_validation.php... but looking through the source code, I could see that the configuration array is passed to the Form_validation constructor. So I just had to modify my constructor statement in libraries/MY_Form_validation.php script to match the parent constructor: Code: class MY_Form_validation extends CI_Form_validation { It must be late... but this wasn't immediately obvious... I guess the lesson here is to look at how the parent is constructed before you extend it.
[eluser]Aether[/eluser]
Thank you for this reply! I made a same mistake and fix it! |
Welcome Guest, Not a member yet? Register Sign In |