JQuery を使用して動的 ID を選択する必要があります。選択したら、何らかのアクションを実行する必要があります。これは私が持っているHTMLです:
<input id="content_photos_attributes_1355755712119_image" name="content[photos_attributes][1355755712119][image]" size="30" type="file">
id 値に注意してください。テキストは常に同じですが、数値は変わります (私はその変更を制御できません)。
私がする必要があるのは、その要素をクリックして作成することです。これは私がこれまでに得たものであり、機能していません。
<script type="text/javascript">
jQuery.noConflict();
jQuery("input[id *= 'content_photos_attributes_']").click(function() {
alert("Image deletion is clicked");
});
</script>
その要素を ID で選択するか、名前で選択するかは実際には違いはありません。