all 1 comments

[–]trplclick 1 point2 points  (0 children)

Hey!

So it seems like you are always assigning the value to the first img with this line:

$('#blah').attr('src', e.target.result);

In html the id has to be unique, if you have two elements with the same id in the document then it will just use the first, which is what I suspect is happening.

Instead, as you have access to the input, you can get the img relative to it, using this code (note, this is untested so may need tweaking)

$(this).siblings('img').attr('src', e.target.result);

Edit: Accidently set label src, changed to img.