Welcome Guest, Not a member yet? Register   Sign In
Question about form_validation prepped data
#1

[eluser]0plus1[/eluser]
I have an ajax request that points to this method inside the controller:

Code:
function edit_description(){
        //
        $uid = $this->authorizer->isLogged();
                
        //Validation
        $this->load->library('form_validation');
        $this->form_validation->set_rules('id', 'ID', 'required');
        $this->form_validation->set_rules('value', 'Value', 'required|xss_clean|strip_tags|prep_url');
        //
        $id = $this->input->post('id');
        $string = $this->input->post('value');
        //
        if ($this->form_validation->run() == FALSE) {
            die('Direct access not allowed');
        } else {
            //$this->majax->edtDescription($uid,$id,$string);
            echo $string;
        }        
    }

How come that the strip_tags gets completely ignored? Do I have to access the new data in another fashion other than input->post?


p.s. majax is the Model that edits the data.
#2

[eluser]n0xie[/eluser]
The validation rules don't actually change the input data.
#3

[eluser]0plus1[/eluser]
[quote author="n0xie" date="1254499203"]The validation rules don't actually change the input data.[/quote]

ah! Then why there are function that prep data?


Edit: I get it now, to prep data for form repopulation.. sorry




Theme © iAndrew 2016 - Forum software by © MyBB