posted 2 years ago
The answer to this is to make each "id=" unique. In this case id="photo" needs to change to "id="'+obj.eventId+'"' and "id="campImage""chages to "id="campImage'+obj.eventId+'"".The eventId is the primary key for the row in the table and is therefore unique.
The code is:
So you now ask, if the "id" changes each time how do I recognise it has changed? Well in the class add a unique name, I use "photo-input" and use that. So the JS is:
So, you will notice that I have id set to a unique value for each tab. I then append that value to the input id that I want to populate (picture is not the only one in this form, I have kept this simple).