[eluser]alboyd[/eluser]
Wow man - you are a legend. Thanks heaps for this - it's brilliant.
EDIT: It worked the first time but now my form validation is always evaluating to TRUE even when I have never opened the page.. WTF is up with that?
EDIT: OK Now I have spent ages trying to figure out why this isn't working. All I know is the following:
1. My form has one field which is the "userfile" input.
2. I load my page i get a blank page.
3. I add a new validation rule for field "something" and set it to "required" then my page loads (with a validation error)
?? Am I being really stupid??
EDIT EDIT EDIT:
I have added the following to my form loading controller function and now it works fine.
Code:
if (count($_POST)+count($_FILES) > 0)
{
$this->form_validation->set_rules('userfile', 'Poster Image', 'file_required|xss_clean|file_allowed_type[image]|file_size_max[2000]');
}