我已經動態加載領域的按鈕一樣點擊功能
<input class="upload_image_23" type="text" size="36" name="products_image_large_new_23" value="" />
<input class="upload_image_button_24" type="button" value="Upload Image" />
<input class="upload_image_23" type="text" size="36" name="products_image_large_new_23" value="" />
<input class="upload_image_button_24" type="button" value="Upload Image" />
現在我想改變這個jQuery功能適用於所有upload_image_button_[any-number]
和products_image_large_new_[any-number]
jQuery(document).ready(function() {
jQuery('.upload_image_button_[any-number]').click(function() {
formfield = jQuery('.upload_image_[any-number]').attr('name');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
return false;
});
window.send_to_editor = function(html) {
imgurl = jQuery('img',html).attr('src');
jQuery('.upload_image_[any-number]').val(imgurl);
tb_remove();
}
});
我應該包括[any-number]
?
標識** **必須是唯一的。 – j08691