Welcome Guest, Not a member yet? Register   Sign In
trim|valid_email not working in validation
#10

(This post was last modified: 01-08-2018, 05:06 AM by 040mag.)

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'].
Reply


Messages In This Thread
RE: trim|valid_email not working in validation - by 040mag - 01-08-2018, 05:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB