Welcome Guest, Not a member yet? Register   Sign In
Need assist Filtering Comments/Returning Errors to appropriate view.
#3

[eluser]dancrew32[/eluser]
[quote author="bargainph" date="1242807007"]First of all, try using the new Form_Validation Library. The Validation Library you are using has been deprecated.[/quote]

I loaded that new Form_Validation library and updated the validation in the view and controller.

here is the new movie_comment_view.php and Movie.php

Still not sure how to get back to the add/display comments view after passing invalid data:

Code:
if ($this->form_validation->run() == FALSE) {
    $this->load->view('front/movie_comment_view', $data); // Pass Back invalid data
        // Need some kind of way to get back to 'movie/comments/'. $data['movie_id'] with error messages
} else {
    $this->Movie_model->insertRow('movie_comments', $data);
    redirect('movie/comments/'. $data['movie_id']);    
}

Here are the errors that I'm getting after entering just a ['comment'] and leaving ['author'] blank (in an attempt to input invalid data: Errors.png


Messages In This Thread
Need assist Filtering Comments/Returning Errors to appropriate view. - by El Forum - 05-19-2009, 09:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB