JavaScript upload multiple images <p>I have 2 upload buttons on same admin page (wordpress). Separately, they works perfect. But together, they don't work as it should. I'm sure it's from the JavaScript file because if I remove the code lines from one button, the other one works.</p> <pre><code>jQuery(document).ready(function($){ $('#upload_logo_button').click(function() { tb_show('Upload a logo', 'media-upload.php?referer=wptuts-settings&amp;amp;type=image&amp;amp;TB_iframe=true&amp;amp;post_id=0', false); return false; }); window.send_to_editor = function(html) { var image_url = $('img',html).attr('src'); $('#logo_url').val(image_url); tb_remove(); $('#upload_logo_preview img').attr('src',image_url); $('#submit_options_form').trigger('click'); } $('#upload_banner_button').click(function() { tb_show('Upload a banner', 'media-upload.php?referer=wptuts-settings&amp;amp;type=image&amp;amp;TB_iframe=true&amp;amp;post_id=0', false); return false; }); window.send_to_editor = function(html) { var img_url = $('img',html).attr('src'); $('#banner_url').val(img_url); tb_remove(); $('#upload_banner_preview img').attr('src',img_url); $('#submit_options_form').trigger('click'); } }); </code></pre> <p>Thanks!</p>