Welcome Guest, Not a member yet? Register   Sign In
Question about uploading pics and jquery
#1

[eluser]joeizang[/eluser]
hey guys,

it's been a great adventure learning and using CI and I am saying this honestly the forum is almost the best I have ever used.
Anyway enof talk, I have a question like the title of this post says.

I have a form that pictures for an intranet application get uploaded through. the question is this: do I need to serialize the data from the upload form since I am using ajax with jquery? before I did the ajax thing the form would upload fine but take me away from the upload page. now the error message shows up on the same page with the form like I want it but no picture is uploaded. Below is my jquery code:

[removed]

$.ajax({
url: 'upload_picture',
type: 'POST',
data: $('#uploadpics').serialize(),
beforeSend: function(){
$('#aika').append('<p>Uploading...<img src="../images/ajax-loader.gif"/></p>').show('slow');
},
success: function(data){
window.setTimeout(function(){
$('#aika').empty();
if(parseFloat(data)){
$('#aika').append(data);
} else {
$('#aika').html(data);
}
},2000);
}

[removed]

thanks guys and God bless.


Messages In This Thread
Question about uploading pics and jquery - by El Forum - 10-02-2009, 08:39 PM
Question about uploading pics and jquery - by El Forum - 10-03-2009, 01:20 AM
Question about uploading pics and jquery - by El Forum - 10-03-2009, 05:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB