Welcome Guest, Not a member yet? Register   Sign In
Input = file validation on multipart form
#4

[eluser]$ilovephp[/eluser]
forget form validation class when you are only trying to say that a specific field is required if you are using multipart form. you can actually validate that using:

Code:
if($this->input->post('field_name')!=FALSE)
{
//set your error message and do not call the do_upload function
$error['error_message'] = "field_name is required.";
}
//
//
//
//and later in your code when you load the view
$this->load->view('view_filename',$error);

I opt to use this for one reason:
Why load an entire class (Form Validation Class) when you can do it without much codes?

I suggest you use Form Validation Class when you have multiple fields aside from that of multipart form


Messages In This Thread
Input = file validation on multipart form - by El Forum - 04-24-2010, 08:56 AM
Input = file validation on multipart form - by El Forum - 04-24-2010, 12:10 PM
Input = file validation on multipart form - by El Forum - 04-25-2010, 02:55 PM
Input = file validation on multipart form - by El Forum - 04-25-2010, 08:16 PM
Input = file validation on multipart form - by El Forum - 04-26-2010, 12:25 AM
Input = file validation on multipart form - by El Forum - 04-29-2010, 11:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB