Welcome Guest, Not a member yet? Register   Sign In
what am i missing?
#3

[eluser]cityzen[/eluser]
Thanks a lot Michael. That's the problem, I do like what I'm seeing, but these hangups are driving me nuts!

Here's a good example I'm working through now:

I have a form that has both a file upload and other form elements. When I add in the layer for the form upload errors I'm doing this in my controller:

Code:
if (!$this->upload->do_upload())
{
   $data['uploadErrors'] = $this->upload->display_errors('<strong>','</strong>');
   $data['view'] = 'files/addmod';
   $this->load->view('global/template', $data);
}    
else
{
... save info here ...

On my view, I currently have:

Code:
if($this->validation->error_string){
    echo 'Please correct the following errors:';
    echo $this->validation->error_string;
}

to handle the regular form errors. I would like to add this under it:

Code:
if($uploadErrors){
   echo $uploadErrors;
}

Now what happens is that I have to start declaring $uploadErrors all over the place with anything that touches this view (that handles adding and modifying data). Another somewhat related issue is that I am toggling between if a file is uploaded to show a link to the file and if not it will just show the upload box but this is starting to cause problems as well since the name of the file is $name and the upload is $userfile so I start to get a conflict between $name or $userfile being absent (since they both won't exist at the same time, but there is code in both the view and controller referring to them).

Sorry that is so long winded... I'm giving myself the "i can't go to bed until I figure this out" so I don't punch my wife in the head while I'm sleeping and having nightmares about this!

Also, is there any logical way to group together the validation and upload errors together into one nice package?


Messages In This Thread
what am i missing? - by El Forum - 05-22-2008, 02:47 AM
what am i missing? - by El Forum - 05-22-2008, 02:51 AM
what am i missing? - by El Forum - 05-22-2008, 03:05 AM
what am i missing? - by El Forum - 05-22-2008, 03:38 AM
what am i missing? - by El Forum - 05-22-2008, 04:00 AM
what am i missing? - by El Forum - 05-22-2008, 04:21 AM
what am i missing? - by El Forum - 05-22-2008, 10:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB