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\
This example restores the window.send_to_editor() func by binding the tb_unload event as soju mentioned above.
var targetfield = '';
var orig_send_to_editor = window.send_to_editor;
jQuery('.fwb_uploadbtn').click(function() {
targetfield = jQuery(this).prev('.fwb_uploadimg');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
//restore send_to_editor() when tb closed
jQuery("#TB_window").bind('tb_unload', function () {
window.send_to_editor = orig_send_to_editor;
});
//temporarily redefine send_to_editor()
window.send_to_editor = function(html) {
imgurl = jQuery('img',html).attr('src');
jQuery(targetfield).val(imgurl);
tb_remove();
}
return false;
});