Welcome Guest, Not a member yet? Register   Sign In
form-validation depending on a checkbox
#2

[eluser]Haloperidol[/eluser]
maybe:

Code:
...
   // all the validations you want to run by default
   $this->form_validation->set_rules('email', 'E-mail', 'trim|required|valid_email');

   if (isset($this->input->post('checkbox_name')) && $this->input->post('checkbox_name') == 'on')
   {
      $this->form_validation->set_rules('other_variables', 'blablabla', 'trim|required');
   }

   if ($this->form_validation->run() === TRUE) {
...


Messages In This Thread
form-validation depending on a checkbox - by El Forum - 07-04-2009, 10:27 AM
form-validation depending on a checkbox - by El Forum - 07-04-2009, 02:21 PM
form-validation depending on a checkbox - by El Forum - 07-05-2009, 04:04 AM
form-validation depending on a checkbox - by El Forum - 07-05-2009, 10:38 PM
form-validation depending on a checkbox - by El Forum - 07-06-2009, 01:25 AM
form-validation depending on a checkbox - by El Forum - 09-12-2012, 01:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB