Codeignitor : Errors are not showing |
Controller: <?php class Form_valid12 extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper(array('url','form')); $this->load->library('form_validation'); } function index() { $this->load->view('example35)/signup_view'); } function validate() { if($this->form_validation->run()) { $this->load->view('example35)/signup_success'); } else { $this->load->view('example35)/signup_view'); } } } ?> Validation group in the config:- <?php defined('BASEPATH') OR exit('No direct script access allowed'); $config = array( 'Form_valid12/validate' =>array( array( 'field' => 'user', 'label' => 'Username', 'rules' => array('required','regex_match[/^[a-zA-Z_ ]*$/]','min_length[5]'), 'errors' => array( 'required' => ' %s must not be empty', 'regex_match' => 'Must not contain any number', 'min_length' => 'Should have atleast 5 characters' ) ), array( 'field' => 'pass', 'label' => 'Password', 'rules' => array('required','min_length[5]'), 'errors' => array( 'required' => ' %s must not be empty', 'min_length' => 'Should have atleast 5 characters' ) ), array( 'field' => 'conf_pass', 'label' => 'Confirm Password', 'rules' => array('required','matches[pass]'), 'errors' => array( 'required' => ' %s must not be empty', 'matches' => 'Password must be the same' ) ), array( 'field' => 'email', 'label' => 'Email', 'rules' => array('required','valid_email'), 'errors' => array( 'required' => ' %s must not be empty', 'valid_email' => 'Must be a valid email' ) ), array( 'field' => 'phone', 'label' => 'Phone', 'rules' => array('re