Welcome Guest, Not a member yet? Register   Sign In
Avoiding POSTDATA popup while still using default Validation class...
#1

[eluser]evolve08[/eluser]
Not sure if I'm just doing something wrong or if I'm searching for the wrong thing, but all of the topics I've found don't really seem to solve the problem I'm having.

I'm attempting to use one method for form validation and submission:
Code:
function add()
{
    $data['title'] = "Enter a new component";
          
    $rules['name'] = "trim|htmlentities|required";
    //snip
    $this->validation->set_rules($rules);
            
    $fields['name'] = "name";
    //snip
    $this->validation->set_fields($fields);
          
    if($this->validation->run())
    {
        //post to db
        $this->session->set_flashdata('flash', 'Item has been added');
        redirect('components');
    }
    else
    {
        $this->load->view('header', $data);
        $this->load->view('components/add');
    }
}
It works well, however if I refresh the page after the form fails to validate, if I refresh that page I get a POSTDATA pop-up, which makes complete sense. I'm just wondering what the easiest method is to stop this from happening without writing a decent amount of code for each form.

Basically if I want to avoid the error right now I have to redirect and store the form data in a session. However if I were to do that, then I don't see myself being able to use the form validation class...


Messages In This Thread
Avoiding POSTDATA popup while still using default Validation class... - by El Forum - 06-12-2008, 01:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB