[eluser]callumd[/eluser]
Hi there,
CodeIgniter noob here, still trying to learn the ropes.
So I've been playing with CI's Form_Validation class, and according to the user manual, the following is proper:
Quote:$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');
$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');
What struck me as odd about this is that all the form rules are being set before the system even knows if this is a form submission attempt. Seems like a real waste of resources, and bad logic.
Is there a better way to do it, and if so, why doesn't it appear in the documentation?
Thanks in advance.