Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Calling index() on form validation failure

$
0
0
Hello, I'm doing something like this in my controller:

PHP Code:
       if ($this->form_validation->run() == FALSE) {
 
           $this->index();
 
       } else {
 
           $this->load->view('template/meta-head'$custom);
 
           $this->load->view('template/header');
 
           $this->load->view('fastauditthx');
 
           $this->load->view('template/footer'$custom);
 
       

Basically, if form fails, send back to form, if good, then send to "Thank you view".

For testing I have added only one set_rules() rule:

PHP Code:
$this->form_validation->set_rules('f_eventname''Event Name''required|trim|min_length[3]|max_length[100]|callback_customAlpha'); 

The action goes to index as expected, but f_eventname always seems to fail, no matter what I put in there.

callback_customAlpha is in a helper file that is loaded in the construct function.

Anyway, I thought I'd post here to see what you all think as my eyes are "end of day eyes" right now.

Thanks,
Donovan

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>