Answers for "ci form validation"

PHP
3

codeigniter form_validation email

$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
Posted by: Guest on August-25-2020
0

ci form validation

public function index()
        {
                $this->load->helper(array('form', 'url'));

                $this->load->library('form_validation');

                $this->form_validation->set_rules('username', 'Username', 'required');
                $this->form_validation->set_rules('password', 'Password', 'required',
                        array('required' => 'You must provide a %s.')
                );
                $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
                $this->form_validation->set_rules('email', 'Email', 'required');

                if ($this->form_validation->run() == FALSE)
                {
                        $this->load->view('myform');
                }
                else
                {
                        $this->load->view('formsuccess');
                }
        }
Posted by: Guest on October-27-2021

Browse Popular Code Answers by Language