Welcome Guest, Not a member yet? Register   Sign In
"Unable to load the requested class: form_validation"
#1

[eluser]Bl4cKWid0w[/eluser]
I'm trying to use the form validation class, however, it doesn't seem to be working correctly. This is my code:

Code:
$this->load->helper('form');
           $this->load->library('form_validation');
      $this->form_validation->set_rules('clanName', 'Clan Name', 'required|callback_clanname_check|min_length[5]|max_length[50]');
      $this->form_validation->set_rules('clanMotto', 'Motto', 'required|min_length[5]|maxlength[250]');
      $this->form_validation->set_rules('clanEmail', 'Email', 'required|valid_email');
      
      if($this->form_validation->run() == FALSE){
        $this->load->view('ladders_join', $data);
      } else {
        $this->load->view('ladders_joined');
      }
#2

[eluser]GSV Sleeper Service[/eluser]
form_validation is new to 1.7.0, if you're using an older version you should be loading 'validation'.
..then you'll have to download an old version of CI because they've removed the 1.6.x validation docs from the user guide on codeigniter.com. *facepalm*
#3

[eluser]Pascal Kriete[/eluser]
[quote author="GSV Sleeper Service" date="1225380223"]..then you'll have to download an old version of CI because they've removed the 1.6.x validation docs from the user guide on codeigniter.com. *facepalm*[/quote]

Nope, they just removed the link. It's still there.
#4

[eluser]GSV Sleeper Service[/eluser]
ah ha! thanks for that inparo *bookmarks*
#5

[eluser]Joe_Archer[/eluser]
Bl4cKWid0w, I'd strongly advise upgrading to 1.7 and taking some time updating your validation code. I've just done it on several of my apps and the reduction in code and increase in readability is pretty impressive.
#6

[eluser]drewbee[/eluser]
I agree with Joe. The new form validation class is nothing short of impressive!
#7

[eluser]Bl4cKWid0w[/eluser]
How do I know what version I have on my server? And my coding was referred from the CI user guide.
#8

[eluser]lmv4321[/eluser]
[quote author="Bl4cKWid0w" date="1225408186"]How do I know what version I have on my server? And my coding was referred from the CI user guide.[/quote]
The variable CI_VERSION has the version. It can be found in CodeIgniter.php in the system/codeigniter folder.
#9

[eluser]Bl4cKWid0w[/eluser]
Thanks for the suggestion. I upgraded to 1.7 and it works perfectly now.




Theme © iAndrew 2016 - Forum software by © MyBB