I am using this plugin just like that.
<form ...>

... my other form elements

<p>
  <label for="fileToUpload">Choose File :</label>
  <input id="fileToUpload" type="file" name="fileToUpload" />
  <input type="button" id="upload_btn" value="Upload!"
onclick="ajaxFileUpload();" />
</p>

... other elements,  my form is huge :)
</form>

ajaxFileUpload() does not need to be posting your form. It's already
creating iframe and posting file over this element. So, you can use like
this, i am using with no problem.

2008/2/20, hcvitto <[EMAIL PROTECTED]>:
>
>
> hi
> i'm using the ajaxfileupload plugin from this site
> http://www.phpletter.com/Our-Projects/AjaxFileUpload/ (which works
> great) in a form with different kind of input file. The form is
> "ajaxed" through the $.ajax jquery function. Following the form
> submitting is a mail with the data from the form.
>
> Problem: i use the '$.ajax' and the '$.ajaxFileUpload' on the same
> form which calls for the same php file, which is now called twice,
> once per function. So everytime i submit the form two mails are sent,
> one with the data the other with the file attached.
>
> How can i integrate the ajaxfileupload in my form? anyone does know
> this plugin?
>
> Thanks Vitto
>
> this is my form submit ajax function:
>
> $.ajax({
>         type: "POST",
>         url: "curriculumInvio.php",
>         data: myData,
>         success: function(){
>                                 myFunction
>                         }
>                 });
>
> this is the plugin ajax function:
>
> $.ajaxFileUpload({
>         url:'curriculumInvio.php',
>         secureuri:false,
>         fileElementId:'fileToUpload',
>         dataType: 'json',
>         success: function (data, status){
>                                       plugin stuff,
>                                         }
>                         });
>



-- 
Yılmaz Uğurlu ~ jabber : [EMAIL PROTECTED]  ~ http://www.2nci.com ~ İzmir

Reply via email to