Ajax Upload, for form

Ajax Upload, for form

Hi, i am using this ajax upload plugin from valums. I wish to use it inside a form. my form fields are , name, age and image etc. Now i have this code here which uploads the image.

  1. var upload = new AjaxUpload('#property_i',
  2.         {
  3.         action: 'submitproperty.php',
  4.         autoSubmit: false,
  5.         name: 'property_image',
  6.         onSubmit : function(file , extension){
  7.         alert(file);
  8.         alert(extension);
  9.         },
  10.         onComplete: function(file, response){
  11.         alert(response);
  12.         }
  13.         });
  14.        
  15.         var upload_data = upload.setData({
  16.         'propertytype':'propertytype'
  17.         });
My problem is, i am not able to send the data along with the image. I have a submit button, which upon clicking should be able to send the data along with the file. Has anyone worked around with it. I would insist on using this particular plugin itself. The plugin's demo page says that file uploads can be achieved inside a form. I want to make it work for my project.


Thanks in advance..