First I copy some input variables from a submitted form:
PHP Code:
$this->data['item']['xname'] = $this->input->post('xname');
$this->data['item']['xemail'] = $this->input->post('xemail');
Then I set the validation rules
PHP Code:
$this->form_validation->set_rules('xname','','trim|required');
$this->form_validation->set_rules('xemail','','trim|valid_email');
Then I set what to validate:
PHP Code:
$this->form_validation->set_data($this->data['item']);
Then I validate
PHP Code:
if($this->form_validation->run())
No trim is done on $this->data['item'].