Original Post
I'm writing a web app that makes use of a 3rd party script called SWFUpload. Basically, it allows you to upload multiple files at once (a feature not supported by HTML) and has several nice features. Part of the code I need to modify is the following:
<script type="text/javascript"> var swfu; window.onload = function () { swfu = new SWFUpload({ // Backend settings upload_url: "upload.php", file_post_name: "resume_file", // Flash file settings file_size_limit : "10 MB", file_types : "*.*", // or you could use something like: "*.doc;*.wpd;*.pdf", file_types_description : "All Files", file_upload_limit : 0, file_queue_limit : 1, // Event handler settings swfupload_loaded_handler : swfUploadLoaded, file_dialog_start_handler: fileDialogStart, file_queued_handler : fileQueued, file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, //upload_start_handler : uploadStart, // I could do some client/javascript validation here, but I don't need to.<br> swfupload_preload_handler : preLoad,<br> swfupload_load_failed_handler : loadFailed,<br> upload_progress_handler : uploadProgress,<br> upload_error_handler : uploadError,<br> upload_success_handler : uploadSuccess,<br> upload_complete_handler : uploadComplete,<br><br> // Button Settings<br> button_image_url : "XPButtonUploadText_61x22.png",<br> button_placeholder_id : "spanButtonPlaceholder",<br> button_width: 61,<br> button_height: 22,<br> <br> // Flash Settings<br> flash_url : "../swfupload/swfupload.swf",<br> flash9_url : "../swfupload/swfupload_fp9.swf",<br><br> custom_settings : {<br> progress_target : "fsUploadProgress",<br> upload_successful : false<br> },<br> <br> // Debug settings<br> debug: false<br> });<br><br> };<br> </script><br><br></pre><br><br>Of course, this code will run at window.open and works fine if i install everything from their demo folder. However, I'd like to add a <form> tag to this page with a <select> box that will update the value of upload_url to something like upload.php?id=1 based on user input (basically, I want to be able to upload a file to a specific group not into a generic folder, and for this I need some extra information in my upload.php script). However, I cannot for the life of me figure out how to modify the value of this variable once the page has opened. I've tried adding an onclick action to the <select> tag that runs the following, but i'm just not that familiar with js.<br><br><pre><br><br><select id="varvalue" onmouseup="change_var(swfu)"><br><br>function chage_var(Var)<br>{<br> Var.upload_url = "upload.php?id=".document.getElementByID("varvalue").value<br>}<br><br></pre><br><br>But, I'm here because this doesn't work. Any help would be much appreciated.<br><br><!--EDIT--><span class=editedby><!--/EDIT-->[Edited by - Cygnus_X on June 6, 2010 10:52:09 AM]<!--EDIT--></span><!--/EDIT--></code></pre>