views:

337

answers:

1

How can i send some parameters, that they aren't defined when the page loads, i have a select box, and i also need to send to php, the selected value.So here my code

    var _data = $('#art:selected').val();

 $('#art').live('change',function(){
   $selected = $(":selected",this);
   id = $selected.val();
     _data = id;
 });

$('.vla').live('click',function(){

        $("#uploadify").uploadifyUpload();
        return false;
});
$("#uploadify").uploadify({
        'uploader'       : '/extra/flash/uploadify.swf',
        'script'         : '/admin/uploads/artistsphotos',
        'scriptData'     : {'title' : _data},
        'cancelImg'      : '/images/cancel.png',
        'folder'         : '/img/artists',
        'queueID'        : 'fileQueue',
        'auto'           : false,
        'multi'          : true,
    'onComplete'     : function(a, b, c, d, e){
        console.log(d);
    },  
    'onAllComplete': function(event,data){  
         //something here  
         //alert(data);
     }
});

The field has the id #art, and i'm trying to get the selected value, when I submit, any solutions?

+1  A: 

What I did when i encountered this problem was that I made a separate form to handle the settings and had it submitted to a processing script that stored the data as session data and then accessed that session data from the upload processing script. I don't know if this is the best way to handle it but it works.

You could also use the onComplete function to collect the form data and send it to a script to be processed. the Oncomplete function has access to the file information for the file that just finished uploading.

X3no
Yeah, I will try this thing out.
Uffo