title: SWFupload - passing variable from form with upload
body: <p>I am refering to the simpledemo in this question <a href="http://demo.swfupload.org/v220/simpledemo/index.php" rel="nofollow">http://demo.swfupload.org/v220/simpledemo/index.php</a></p>
  
  <p>I want to be able to pass a variable which is set by a dropdown menu.</p>
  
  <p>the uploader is initiated by </p>
  
  <pre><code>var swfu;
  window.onload = function() {
      var settings = {
          flash_url : "&lt;?php global_data::show_admin_dir(); ?&gt;SWFUpload v2.2.0.1 Samples/demos/swfupload/swfupload.swf",
          upload_url: "&lt;?php global_data::show_admin_dir(); ?&gt;upload.php",
          post_params: {"PHPSESSID" : "&lt;?php echo session_id(); ?&gt;" },
          file_size_limit : "100 MB",
          file_types : "*.*",
          file_types_description : "All Files",
          file_upload_limit : 100,
          file_queue_limit : 0,
          custom_settings : {
              progressTarget : "fsUploadProgress",
              cancelButtonId : "btnCancel"
          },
          debug: false,
                  // Button settings
          button_image_url: "images/TestImageNoText_65x29.png",
          button_width: "95",
          button_height: "29",
          button_placeholder_id: "spanButtonPlaceHolder",
          button_text: '&lt;span class="theFont"&gt;UPLOAD&lt;/span&gt;',
          button_text_style: ".theFont { font-size: 16; }",
          button_text_left_padding: 12,
          button_text_top_padding: 3,
  
          // The event handler functions are defined in handlers.js
          file_queued_handler : fileQueued,
          file_queue_error_handler : fileQueueError,
          file_dialog_complete_handler : fileDialogComplete,
          upload_start_handler : uploadStart,
          upload_progress_handler : uploadProgress,
          upload_error_handler : uploadError,
          upload_success_handler : uploadSuccess,
          upload_complete_handler : uploadComplete,
          queue_complete_handler : queueComplete  // Queue plugin event
      };
  
      swfu = new SWFUpload(settings);
   };
  </code></pre>
  
  <p>and the form is as follows</p>
  
  <pre><code>&lt;form id="form1" action="index.php" method="post" enctype="multipart/form-data"&gt;
          &lt;p&gt;&lt;label&gt;Category: &lt;/label&gt;&lt;input type="radio" name="for" class="radio" value="category" checked="checked" /&gt;&lt;select name="foo"&gt;&lt;option&gt;...&lt;/option&gt;&lt;?php global_data::show_breadcrum_list( 'option', " / " ); ?&gt;&lt;/select&gt;&lt;/p&gt;
          &lt;p&gt;&lt;label&gt;Product: &lt;/label&gt;&lt;input type="radio" name="for" class="radio" value="category" /&gt;&lt;select disabled="disabled"&gt;&lt;option name="foo"&gt;...&lt;/option&gt;&lt;?php global_data::show_breadcrum_list( 'option', " / " ); ?&gt;&lt;/select&gt;&lt;/p&gt;    
          &lt;div class="fieldset flash" id="fsUploadProgress"&gt;
              &lt;span class="legend"&gt;Upload Queue&lt;/span&gt;
          &lt;/div&gt;
          &lt;div id="divStatus"&gt;0 Files Uploaded&lt;/div&gt;
          &lt;div&gt;
              &lt;span id="spanButtonPlaceHolder"&gt;&lt;/span&gt;
              &lt;input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" /&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>if anyone could point me in the right direction it would be much appreciated.</p>
  
  <p>###### EDIT #####
  I may have found a way...</p>
  
  <p>using <code>post_params: {"PHPSESSID" : "&lt;?php echo session_id(); ?&gt;", "PR" : thing },</code>
  in the init settings and wrapping it all in a function</p>
  
  <pre><code>function loader( thing ) {
      ....
  }
  </code></pre>
  
  <p>and then using </p>
  
  <pre><code>$(document).ready(function(){
      $('select[name=foo]').change(function(){
          loader( $(':selected', this).text() );
      });
  });
  </code></pre>
  
  <p>it will work, but if i change the select option a second time before uploading it will get an error and only send the first choice instead of the second...</p>