Welcome Guest, Not a member yet? Register   Sign In
Display form validation errors in an unordered list in a proper way.
#1

[eluser]Bramme[/eluser]
Hey everybody

I'm trying to display my form validation errors in a pretty way, but find it difficult to do this elegantly.

At the moment, I just do
Code:
$validation_errors = validation_errors('<li>', '</li>');
if ( ! empty($validation_errors))
{
    $data['message'] = '<ul>'.$validation_errors.'</ul>';
    $this->template->write_view('_feedback_message', $this->config->item('template_folder').'/partials/feedback_alert', $data);
}
But this feels incredibly sloppy. Having the html just there in my controller feels clunky, and cleaning it up by putting it all in a helper function, also doesn't ease my concious.

Any suggestions?


Messages In This Thread
Display form validation errors in an unordered list in a proper way. - by El Forum - 01-05-2011, 02:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB