CodeIgniter Forums

Full Version: Question about form_validation prepped data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have an ajax request that points to this method inside the controller:

function edit_description(){
        $uid = $this->authorizer->isLogged();
        $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 {
            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.

El Forum

The validation rules don't actually change the input data.

El Forum

[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