Welcome Guest, Not a member yet? Register   Sign In
Processing an image before the form submits
#4

[eluser]NateL[/eluser]
Well here is my first attempt at it. I hope someone can tell me what I am doing wrong

this is just setting it up, trying to get the browser to react to the image uploading. (not actually processing the image yet)

I'm using jQuery and Ajax Upload. I'm following some of the demos they have on their page, but it's a bit more difficult since I'm using the MVC of CodeIgniter

My view calls in jQuery and Ajax upload, and then I have the following JS:
Code:
< script type= "text/javascript">
    $(document).ready(function(){
        new Ajax_upload('#uploadBtn', {
            action: '<?=base_url()?>admin/product/addImage',
            name: 'image',
            
            onComplete : function(file, response){
                    $('#uploadBtn .text').text('Uploaded');
                }
            });
    });
< /script>

On down the page, I have this HTML:

Code:
<div id="uploadBtn">Upload</div>
<p class="text"></p>

and in my controller:
Code:
function addImage()
    {
      echo 'success';
    }

nothing seems to be happening. Do I need to pass the result of addImage() back into the view?


Messages In This Thread
Processing an image before the form submits - by El Forum - 01-28-2009, 07:33 PM
Processing an image before the form submits - by El Forum - 01-28-2009, 07:46 PM
Processing an image before the form submits - by El Forum - 01-28-2009, 07:58 PM
Processing an image before the form submits - by El Forum - 02-03-2009, 12:45 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 05:15 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 06:12 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 06:13 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 09:43 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 10:26 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 10:35 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 11:00 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 11:33 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 11:45 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 11:49 AM
Processing an image before the form submits - by El Forum - 02-03-2009, 12:04 PM
Processing an image before the form submits - by El Forum - 02-03-2009, 01:22 PM
Processing an image before the form submits - by El Forum - 11-13-2009, 09:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB