Couldn\'t come up with a good title for this.
I\'ve got a build in WordPress where I have multiple image uploads using the built in WordPress media uploader. How it\
Here is my solution. This will allow you to upload any doc images, PDF's etc & will sort out the conflict issues that one will get with the text editors
var uploadID = ''; // setup the var in a global scope
var original_send_to_editor = window.send_to_editor;
jQuery('.upload-button').click(function() {
uploadID = jQuery(this).prev('input'); // set the uploadID variable to the value of the input before the upload button
formfield = jQuery('.upload').attr('name');
tb_show('', 'media-upload.php?TB_iframe=true');
uploadBAR(); // Call if needed
return false;
});
function uploadBAR() {
window.send_to_editor = function(html) {
imgurl = jQuery(html).attr('href');
uploadID.val(imgurl); /*assign the value of the image src to the input*/
tb_remove();
window.send_to_editor = original_send_to_editor;//restore old send to editor function
};
}